From 3371e883aba133ef649e718c0c8cd5978dda0126 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 12 May 2023 13:46:39 +0800 Subject: [PATCH] Decommission python-legacy, python-prior client generators (#15475) * decommission python-legacy, python-prior client generators * update tests * update doc --- bin/configs/python-asyncio.yaml | 7 - bin/configs/python-legacy-oas2.yaml | 6 - bin/configs/python-legacy.yaml | 6 - ...thon-prior-extensions-x-auth-id-alias.yaml | 6 - bin/configs/python-prior-oas2.yaml | 10 - ...allowAdditionalPropertiesIfNotPresent.yaml | 7 - bin/configs/python-prior.yaml | 8 - bin/configs/python-tornado.yaml | 7 - docs/generators.md | 2 - docs/generators/python-legacy.md | 231 - docs/generators/python-prior.md | 235 - .../codegen/DefaultGenerator.java | 3 +- .../languages/PythonLegacyClientCodegen.java | 465 -- .../languages/PythonPriorClientCodegen.java | 1521 ------ .../org.openapitools.codegen.CodegenConfig | 2 - .../resources/python-legacy/README.mustache | 55 - .../python-legacy/README_onlypackage.mustache | 43 - .../resources/python-legacy/__init__.mustache | 0 .../python-legacy/__init__api.mustache | 7 - .../python-legacy/__init__model.mustache | 10 - .../python-legacy/__init__package.mustache | 29 - .../main/resources/python-legacy/api.mustache | 300 -- .../python-legacy/api_client.mustache | 725 --- .../resources/python-legacy/api_doc.mustache | 76 - .../python-legacy/api_doc_example.mustache | 26 - .../resources/python-legacy/api_test.mustache | 37 - .../python-legacy/asyncio/rest.mustache | 239 - .../python-legacy/common_README.mustache | 77 - .../python-legacy/configuration.mustache | 646 --- .../python-legacy/exceptions.mustache | 155 - .../python-legacy/git_push.sh.mustache | 57 - .../python-legacy/gitignore.mustache | 66 - .../python-legacy/gitlab-ci.mustache | 38 - .../resources/python-legacy/model.mustache | 257 - .../python-legacy/model_doc.mustache | 14 - .../python-legacy/model_test.mustache | 64 - .../python-legacy/partial_header.mustache | 17 - .../python_doc_auth_partial.mustache | 109 - .../python-legacy/requirements.mustache | 5 - .../resources/python-legacy/rest.mustache | 293 -- .../resources/python-legacy/setup.mustache | 46 - .../python-legacy/setup_cfg.mustache | 13 - .../python-legacy/test-requirements.mustache | 17 - .../python-legacy/tornado/rest.mustache | 224 - .../main/resources/python-legacy/tox.mustache | 14 - .../resources/python-legacy/travis.mustache | 22 - .../resources/python-prior/README.mustache | 55 - .../python-prior/README_common.mustache | 112 - .../python-prior/README_onlypackage.mustache | 42 - .../resources/python-prior/__init__.mustache | 0 .../python-prior/__init__api.mustache | 9 - .../python-prior/__init__apis.mustache | 23 - .../python-prior/__init__model.mustache | 5 - .../python-prior/__init__models.mustache | 16 - .../python-prior/__init__package.mustache | 26 - .../main/resources/python-prior/api.mustache | 326 -- .../python-prior/api_client.mustache | 919 ---- .../resources/python-prior/api_doc.mustache | 79 - .../python-prior/api_doc_example.mustache | 76 - .../resources/python-prior/api_test.mustache | 32 - .../python-prior/asyncio/rest.mustache | 237 - .../python-prior/configuration.mustache | 633 --- .../python-prior/exceptions.mustache | 150 - .../python-prior/git_push.sh.mustache | 57 - .../resources/python-prior/gitignore.mustache | 66 - .../resources/python-prior/gitlab-ci.mustache | 29 - .../resources/python-prior/model.mustache | 58 - .../resources/python-prior/model_doc.mustache | 37 - .../model_templates/classvars.mustache | 138 - .../docstring_allowed.mustache | 4 - .../docstring_init_required_kwargs.mustache | 30 - .../docstring_openapi_validations.mustache | 7 - .../model_templates/invalid_pos_args.mustache | 13 - ...method_from_openapi_data_composed.mustache | 79 - .../method_from_openapi_data_normal.mustache | 17 - .../method_from_openapi_data_shared.mustache | 49 - .../method_from_openapi_data_simple.mustache | 62 - .../method_init_composed.mustache | 93 - .../method_init_normal.mustache | 30 - .../method_init_shared.mustache | 52 - .../method_init_simple.mustache | 66 - .../method_set_attribute.mustache | 51 - .../methods_setattr_getattr_composed.mustache | 103 - .../methods_setattr_getattr_normal.mustache | 32 - .../model_templates/methods_shared.mustache | 34 - .../methods_todict_tostr_eq_shared.mustache | 24 - .../methods_tostr_eq_simple.mustache | 16 - .../model_templates/model_composed.mustache | 74 - .../model_templates/model_normal.mustache | 44 - .../model_templates/model_simple.mustache | 22 - .../model_templates/validations.mustache | 34 - .../python-prior/model_test.mustache | 34 - .../python-prior/model_utils.mustache | 1741 ------- .../python-prior/partial_header.mustache | 17 - .../python_doc_auth_partial.mustache | 109 - .../python-prior/requirements.mustache | 3 - .../main/resources/python-prior/rest.mustache | 348 -- .../resources/python-prior/setup.mustache | 51 - .../resources/python-prior/setup_cfg.mustache | 13 - .../resources/python-prior/signing.mustache | 408 -- .../python-prior/test-requirements.mustache | 13 - .../python-prior/tornado/rest.mustache | 222 - .../main/resources/python-prior/tox.mustache | 9 - .../resources/python-prior/travis.mustache | 18 - .../options/PythonClientOptionsProvider.java | 64 - .../PythonLegacyClientOptionsProvider.java | 59 - .../python/PythonLegacyClientCodegenTest.java | 387 -- .../python/PythonLegacyClientOptionsTest.java | 54 - .../python/PythonPriorClientOptionsTest.java | 54 - .../codegen/python/PythonPriorClientTest.java | 562 --- pom.xml | 22 - .../client/petstore/python-asyncio/.gitignore | 66 - .../petstore/python-asyncio/.gitlab-ci.yml | 33 - .../python-asyncio/.openapi-generator-ignore | 23 - .../python-asyncio/.openapi-generator/FILES | 126 - .../python-asyncio/.openapi-generator/VERSION | 1 - .../petstore/python-asyncio/.travis.yml | 17 - .../client/petstore/python-asyncio/Makefile | 18 - .../client/petstore/python-asyncio/README.md | 214 - .../python-asyncio/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesAnyType.md | 11 - .../docs/AdditionalPropertiesArray.md | 11 - .../docs/AdditionalPropertiesBoolean.md | 11 - .../docs/AdditionalPropertiesClass.md | 21 - .../docs/AdditionalPropertiesInteger.md | 11 - .../docs/AdditionalPropertiesNumber.md | 11 - .../docs/AdditionalPropertiesObject.md | 11 - .../docs/AdditionalPropertiesString.md | 11 - .../petstore/python-asyncio/docs/Animal.md | 12 - .../python-asyncio/docs/AnotherFakeApi.md | 71 - .../python-asyncio/docs/ApiResponse.md | 13 - .../docs/ArrayOfArrayOfNumberOnly.md | 11 - .../python-asyncio/docs/ArrayOfNumberOnly.md | 11 - .../petstore/python-asyncio/docs/ArrayTest.md | 13 - .../petstore/python-asyncio/docs/BigCat.md | 11 - .../python-asyncio/docs/BigCatAllOf.md | 11 - .../python-asyncio/docs/Capitalization.md | 16 - .../petstore/python-asyncio/docs/Cat.md | 11 - .../petstore/python-asyncio/docs/CatAllOf.md | 11 - .../petstore/python-asyncio/docs/Category.md | 12 - .../python-asyncio/docs/ClassModel.md | 12 - .../petstore/python-asyncio/docs/Client.md | 11 - .../petstore/python-asyncio/docs/Dog.md | 11 - .../petstore/python-asyncio/docs/DogAllOf.md | 11 - .../python-asyncio/docs/EnumArrays.md | 12 - .../petstore/python-asyncio/docs/EnumClass.md | 10 - .../petstore/python-asyncio/docs/EnumTest.md | 15 - .../petstore/python-asyncio/docs/FakeApi.md | 943 ---- .../docs/FakeClassnameTags123Api.md | 82 - .../petstore/python-asyncio/docs/File.md | 12 - .../docs/FileSchemaTestClass.md | 12 - .../python-asyncio/docs/FormatTest.md | 24 - .../python-asyncio/docs/HasOnlyReadOnly.md | 12 - .../petstore/python-asyncio/docs/List.md | 11 - .../petstore/python-asyncio/docs/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../python-asyncio/docs/Model200Response.md | 13 - .../python-asyncio/docs/ModelReturn.md | 12 - .../python-asyncio/docs/Model_200Response.md | 13 - .../python-asyncio/docs/Model_Return.md | 12 - .../petstore/python-asyncio/docs/Name.md | 15 - .../python-asyncio/docs/NumberOnly.md | 11 - .../petstore/python-asyncio/docs/Order.md | 16 - .../python-asyncio/docs/OuterComposite.md | 13 - .../petstore/python-asyncio/docs/OuterEnum.md | 10 - .../petstore/python-asyncio/docs/Pet.md | 16 - .../petstore/python-asyncio/docs/PetApi.md | 681 --- .../python-asyncio/docs/ReadOnlyFirst.md | 12 - .../python-asyncio/docs/SpecialModelName.md | 11 - .../petstore/python-asyncio/docs/StoreApi.md | 268 -- .../petstore/python-asyncio/docs/Tag.md | 12 - .../python-asyncio/docs/TypeHolderDefault.md | 15 - .../python-asyncio/docs/TypeHolderExample.md | 16 - .../petstore/python-asyncio/docs/User.md | 18 - .../petstore/python-asyncio/docs/UserApi.md | 501 -- .../petstore/python-asyncio/docs/XmlItem.md | 39 - .../petstore/python-asyncio/git_push.sh | 57 - .../python-asyncio/petstore_api/__init__.py | 85 - .../petstore_api/api/__init__.py | 11 - .../petstore_api/api/another_fake_api.py | 182 - .../petstore_api/api/fake_api.py | 2230 --------- .../api/fake_classname_tags123_api.py | 182 - .../api/fake_classname_tags_123_api.py | 181 - .../petstore_api/api/pet_api.py | 1332 ------ .../petstore_api/api/store_api.py | 574 --- .../petstore_api/api/user_api.py | 1100 ----- .../python-asyncio/petstore_api/api_client.py | 702 --- .../petstore_api/configuration.py | 518 --- .../python-asyncio/petstore_api/exceptions.py | 163 - .../petstore_api/models/__init__.py | 64 - .../models/additional_properties_any_type.py | 131 - .../models/additional_properties_array.py | 131 - .../models/additional_properties_boolean.py | 131 - .../models/additional_properties_class.py | 391 -- .../models/additional_properties_integer.py | 131 - .../models/additional_properties_number.py | 131 - .../models/additional_properties_object.py | 131 - .../models/additional_properties_string.py | 131 - .../petstore_api/models/animal.py | 170 - .../petstore_api/models/api_response.py | 183 - .../models/array_of_array_of_number_only.py | 131 - .../models/array_of_number_only.py | 131 - .../petstore_api/models/array_test.py | 183 - .../petstore_api/models/big_cat.py | 137 - .../petstore_api/models/big_cat_all_of.py | 137 - .../petstore_api/models/capitalization.py | 263 -- .../python-asyncio/petstore_api/models/cat.py | 131 - .../petstore_api/models/cat_all_of.py | 131 - .../petstore_api/models/category.py | 158 - .../petstore_api/models/class_model.py | 131 - .../petstore_api/models/client.py | 131 - .../python-asyncio/petstore_api/models/dog.py | 131 - .../petstore_api/models/dog_all_of.py | 131 - .../petstore_api/models/enum_arrays.py | 171 - .../petstore_api/models/enum_class.py | 112 - .../petstore_api/models/enum_test.py | 260 -- .../petstore_api/models/file.py | 133 - .../models/file_schema_test_class.py | 157 - .../petstore_api/models/format_test.py | 515 -- .../petstore_api/models/has_only_read_only.py | 157 - .../petstore_api/models/list.py | 131 - .../petstore_api/models/map_test.py | 217 - ...perties_and_additional_properties_class.py | 183 - .../petstore_api/models/model200_response.py | 157 - .../petstore_api/models/model_200_response.py | 157 - .../petstore_api/models/model_return.py | 131 - .../petstore_api/models/name.py | 210 - .../petstore_api/models/number_only.py | 131 - .../petstore_api/models/order.py | 269 -- .../petstore_api/models/outer_composite.py | 183 - .../petstore_api/models/outer_enum.py | 112 - .../python-asyncio/petstore_api/models/pet.py | 271 -- .../petstore_api/models/read_only_first.py | 157 - .../petstore_api/models/special_model_name.py | 131 - .../python-asyncio/petstore_api/models/tag.py | 157 - .../models/type_holder_default.py | 240 - .../models/type_holder_example.py | 267 -- .../petstore_api/models/user.py | 315 -- .../petstore_api/models/xml_item.py | 859 ---- .../python-asyncio/petstore_api/rest.py | 247 - .../client/petstore/python-asyncio/pom.xml | 46 - .../petstore/python-asyncio/requirements.txt | 5 - .../client/petstore/python-asyncio/setup.cfg | 2 - .../client/petstore/python-asyncio/setup.py | 43 - .../python-asyncio/test-requirements.txt | 3 - .../petstore/python-asyncio/test/__init__.py | 0 .../test_additional_properties_any_type.py | 39 - .../test/test_additional_properties_array.py | 39 - .../test_additional_properties_boolean.py | 39 - .../test/test_additional_properties_class.py | 39 - .../test_additional_properties_integer.py | 39 - .../test/test_additional_properties_number.py | 39 - .../test/test_additional_properties_object.py | 39 - .../test/test_additional_properties_string.py | 39 - .../python-asyncio/test/test_animal.py | 39 - .../test/test_another_fake_api.py | 40 - .../python-asyncio/test/test_api_response.py | 39 - .../test_array_of_array_of_number_only.py | 39 - .../test/test_array_of_number_only.py | 39 - .../python-asyncio/test/test_array_test.py | 39 - .../python-asyncio/test/test_big_cat.py | 39 - .../test/test_big_cat_all_of.py | 39 - .../test/test_capitalization.py | 39 - .../petstore/python-asyncio/test/test_cat.py | 39 - .../python-asyncio/test/test_cat_all_of.py | 39 - .../python-asyncio/test/test_category.py | 39 - .../python-asyncio/test/test_class_model.py | 39 - .../python-asyncio/test/test_client.py | 39 - .../petstore/python-asyncio/test/test_dog.py | 39 - .../python-asyncio/test/test_dog_all_of.py | 39 - .../python-asyncio/test/test_enum_arrays.py | 39 - .../python-asyncio/test/test_enum_class.py | 39 - .../python-asyncio/test/test_enum_test.py | 39 - .../python-asyncio/test/test_fake_api.py | 98 - .../test/test_fake_classname_tags123_api.py | 40 - .../test/test_fake_classname_tags_123_api.py | 40 - .../petstore/python-asyncio/test/test_file.py | 39 - .../test/test_file_schema_test_class.py | 39 - .../python-asyncio/test/test_format_test.py | 39 - .../test/test_has_only_read_only.py | 39 - .../petstore/python-asyncio/test/test_list.py | 39 - .../python-asyncio/test/test_map_test.py | 39 - ...perties_and_additional_properties_class.py | 39 - .../test/test_model200_response.py | 39 - .../test/test_model_200_response.py | 52 - .../python-asyncio/test/test_model_return.py | 39 - .../petstore/python-asyncio/test/test_name.py | 39 - .../python-asyncio/test/test_number_only.py | 39 - .../python-asyncio/test/test_order.py | 39 - .../test/test_outer_composite.py | 39 - .../python-asyncio/test/test_outer_enum.py | 39 - .../petstore/python-asyncio/test/test_pet.py | 39 - .../python-asyncio/test/test_pet_api.py | 89 - .../test/test_read_only_first.py | 39 - .../test/test_special_model_name.py | 39 - .../python-asyncio/test/test_store_api.py | 61 - .../petstore/python-asyncio/test/test_tag.py | 39 - .../test/test_type_holder_default.py | 39 - .../test/test_type_holder_example.py | 39 - .../petstore/python-asyncio/test/test_user.py | 39 - .../python-asyncio/test/test_user_api.py | 89 - .../python-asyncio/test/test_xml_item.py | 39 - .../petstore/python-asyncio/test_python3.sh | 31 - .../petstore/python-asyncio/testfiles/foo.png | Bin 43280 -> 0 bytes .../petstore/python-asyncio/tests/__init__.py | 0 .../python-asyncio/tests/test_api_client.py | 27 - .../python-asyncio/tests/test_pet_api.py | 212 - .../petstore/python-asyncio/tests/util.py | 18 - .../client/petstore/python-asyncio/tox.ini | 9 - .../client/petstore/python-legacy/.gitignore | 66 - .../petstore/python-legacy/.gitlab-ci.yml | 33 - .../python-legacy/.openapi-generator-ignore | 23 - .../python-legacy/.openapi-generator/FILES | 126 - .../python-legacy/.openapi-generator/VERSION | 1 - .../client/petstore/python-legacy/.travis.yml | 17 - .../client/petstore/python-legacy/Makefile | 21 - .../client/petstore/python-legacy/README.md | 214 - .../python-legacy/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesAnyType.md | 11 - .../docs/AdditionalPropertiesArray.md | 11 - .../docs/AdditionalPropertiesBoolean.md | 11 - .../docs/AdditionalPropertiesClass.md | 21 - .../docs/AdditionalPropertiesInteger.md | 11 - .../docs/AdditionalPropertiesNumber.md | 11 - .../docs/AdditionalPropertiesObject.md | 11 - .../docs/AdditionalPropertiesString.md | 11 - .../petstore/python-legacy/docs/Animal.md | 12 - .../python-legacy/docs/AnotherFakeApi.md | 71 - .../python-legacy/docs/ApiResponse.md | 13 - .../docs/ArrayOfArrayOfNumberOnly.md | 11 - .../python-legacy/docs/ArrayOfNumberOnly.md | 11 - .../petstore/python-legacy/docs/ArrayTest.md | 13 - .../petstore/python-legacy/docs/BigCat.md | 11 - .../python-legacy/docs/BigCatAllOf.md | 11 - .../python-legacy/docs/Capitalization.md | 16 - .../client/petstore/python-legacy/docs/Cat.md | 11 - .../petstore/python-legacy/docs/CatAllOf.md | 11 - .../petstore/python-legacy/docs/Category.md | 12 - .../petstore/python-legacy/docs/ClassModel.md | 12 - .../petstore/python-legacy/docs/Client.md | 11 - .../client/petstore/python-legacy/docs/Dog.md | 11 - .../petstore/python-legacy/docs/DogAllOf.md | 11 - .../petstore/python-legacy/docs/EnumArrays.md | 12 - .../petstore/python-legacy/docs/EnumClass.md | 10 - .../petstore/python-legacy/docs/EnumTest.md | 15 - .../petstore/python-legacy/docs/FakeApi.md | 943 ---- .../docs/FakeClassnameTags123Api.md | 82 - .../petstore/python-legacy/docs/File.md | 12 - .../python-legacy/docs/FileSchemaTestClass.md | 12 - .../petstore/python-legacy/docs/FormatTest.md | 24 - .../python-legacy/docs/HasOnlyReadOnly.md | 12 - .../petstore/python-legacy/docs/List.md | 11 - .../petstore/python-legacy/docs/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../python-legacy/docs/Model200Response.md | 13 - .../python-legacy/docs/ModelReturn.md | 12 - .../python-legacy/docs/Model_200Response.md | 13 - .../python-legacy/docs/Model_Return.md | 12 - .../petstore/python-legacy/docs/Name.md | 15 - .../petstore/python-legacy/docs/NumberOnly.md | 11 - .../petstore/python-legacy/docs/Order.md | 16 - .../python-legacy/docs/OuterComposite.md | 13 - .../petstore/python-legacy/docs/OuterEnum.md | 10 - .../client/petstore/python-legacy/docs/Pet.md | 16 - .../petstore/python-legacy/docs/PetApi.md | 681 --- .../python-legacy/docs/ReadOnlyFirst.md | 12 - .../python-legacy/docs/SpecialModelName.md | 11 - .../petstore/python-legacy/docs/StoreApi.md | 268 -- .../client/petstore/python-legacy/docs/Tag.md | 12 - .../python-legacy/docs/TypeHolderDefault.md | 15 - .../python-legacy/docs/TypeHolderExample.md | 16 - .../petstore/python-legacy/docs/User.md | 18 - .../petstore/python-legacy/docs/UserApi.md | 501 -- .../petstore/python-legacy/docs/XmlItem.md | 39 - .../client/petstore/python-legacy/git_push.sh | 57 - .../python-legacy/petstore_api/__init__.py | 85 - .../petstore_api/api/__init__.py | 11 - .../petstore_api/api/another_fake_api.py | 182 - .../petstore_api/api/fake_api.py | 2230 --------- .../api/fake_classname_tags123_api.py | 182 - .../api/fake_classname_tags_123_api.py | 181 - .../python-legacy/petstore_api/api/pet_api.py | 1332 ------ .../petstore_api/api/store_api.py | 574 --- .../petstore_api/api/user_api.py | 1100 ----- .../python-legacy/petstore_api/api_client.py | 701 --- .../petstore_api/configuration.py | 522 --- .../python-legacy/petstore_api/exceptions.py | 163 - .../petstore_api/models/__init__.py | 64 - .../models/additional_properties_any_type.py | 131 - .../models/additional_properties_array.py | 131 - .../models/additional_properties_boolean.py | 131 - .../models/additional_properties_class.py | 391 -- .../models/additional_properties_integer.py | 131 - .../models/additional_properties_number.py | 131 - .../models/additional_properties_object.py | 131 - .../models/additional_properties_string.py | 131 - .../petstore_api/models/animal.py | 170 - .../petstore_api/models/api_response.py | 183 - .../models/array_of_array_of_number_only.py | 131 - .../models/array_of_number_only.py | 131 - .../petstore_api/models/array_test.py | 183 - .../petstore_api/models/big_cat.py | 137 - .../petstore_api/models/big_cat_all_of.py | 137 - .../petstore_api/models/capitalization.py | 263 -- .../python-legacy/petstore_api/models/cat.py | 131 - .../petstore_api/models/cat_all_of.py | 131 - .../petstore_api/models/category.py | 158 - .../petstore_api/models/class_model.py | 131 - .../petstore_api/models/client.py | 131 - .../python-legacy/petstore_api/models/dog.py | 131 - .../petstore_api/models/dog_all_of.py | 131 - .../petstore_api/models/enum_arrays.py | 171 - .../petstore_api/models/enum_class.py | 112 - .../petstore_api/models/enum_test.py | 260 -- .../python-legacy/petstore_api/models/file.py | 133 - .../models/file_schema_test_class.py | 157 - .../petstore_api/models/format_test.py | 515 -- .../petstore_api/models/has_only_read_only.py | 157 - .../python-legacy/petstore_api/models/list.py | 131 - .../petstore_api/models/map_test.py | 217 - ...perties_and_additional_properties_class.py | 183 - .../petstore_api/models/model200_response.py | 157 - .../petstore_api/models/model_200_response.py | 157 - .../petstore_api/models/model_return.py | 131 - .../python-legacy/petstore_api/models/name.py | 210 - .../petstore_api/models/number_only.py | 131 - .../petstore_api/models/order.py | 269 -- .../petstore_api/models/outer_composite.py | 183 - .../petstore_api/models/outer_enum.py | 112 - .../python-legacy/petstore_api/models/pet.py | 271 -- .../petstore_api/models/read_only_first.py | 157 - .../petstore_api/models/special_model_name.py | 131 - .../python-legacy/petstore_api/models/tag.py | 157 - .../models/type_holder_default.py | 240 - .../models/type_holder_example.py | 267 -- .../python-legacy/petstore_api/models/user.py | 315 -- .../petstore_api/models/xml_item.py | 859 ---- .../python-legacy/petstore_api/rest.py | 301 -- samples/client/petstore/python-legacy/pom.xml | 46 - .../petstore/python-legacy/requirements.txt | 5 - .../client/petstore/python-legacy/setup.cfg | 2 - .../client/petstore/python-legacy/setup.py | 42 - .../python-legacy/test-requirements.txt | 4 - .../petstore/python-legacy/test/__init__.py | 0 .../test_additional_properties_any_type.py | 39 - .../test/test_additional_properties_array.py | 39 - .../test_additional_properties_boolean.py | 39 - .../test/test_additional_properties_class.py | 39 - .../test_additional_properties_integer.py | 39 - .../test/test_additional_properties_number.py | 39 - .../test/test_additional_properties_object.py | 39 - .../test/test_additional_properties_string.py | 39 - .../python-legacy/test/test_animal.py | 54 - .../test/test_another_fake_api.py | 40 - .../python-legacy/test/test_api_response.py | 39 - .../test_array_of_array_of_number_only.py | 39 - .../test/test_array_of_number_only.py | 39 - .../python-legacy/test/test_array_test.py | 39 - .../python-legacy/test/test_big_cat.py | 39 - .../python-legacy/test/test_big_cat_all_of.py | 39 - .../python-legacy/test/test_capitalization.py | 39 - .../petstore/python-legacy/test/test_cat.py | 52 - .../python-legacy/test/test_cat_all_of.py | 39 - .../python-legacy/test/test_category.py | 54 - .../python-legacy/test/test_class_model.py | 39 - .../python-legacy/test/test_client.py | 39 - .../petstore/python-legacy/test/test_dog.py | 39 - .../python-legacy/test/test_dog_all_of.py | 39 - .../python-legacy/test/test_enum_arrays.py | 39 - .../python-legacy/test/test_enum_class.py | 51 - .../python-legacy/test/test_enum_test.py | 39 - .../python-legacy/test/test_fake_api.py | 98 - .../test/test_fake_classname_tags123_api.py | 40 - .../test/test_fake_classname_tags_123_api.py | 40 - .../petstore/python-legacy/test/test_file.py | 52 - .../test/test_file_schema_test_class.py | 57 - .../python-legacy/test/test_format_test.py | 69 - .../test/test_has_only_read_only.py | 39 - .../petstore/python-legacy/test/test_list.py | 39 - .../python-legacy/test/test_map_test.py | 65 - ...perties_and_additional_properties_class.py | 58 - .../test/test_model200_response.py | 39 - .../test/test_model_200_response.py | 52 - .../python-legacy/test/test_model_return.py | 39 - .../petstore/python-legacy/test/test_name.py | 39 - .../python-legacy/test/test_number_only.py | 39 - .../petstore/python-legacy/test/test_order.py | 39 - .../test/test_outer_composite.py | 39 - .../python-legacy/test/test_outer_enum.py | 39 - .../petstore/python-legacy/test/test_pet.py | 69 - .../python-legacy/test/test_pet_api.py | 89 - .../test/test_read_only_first.py | 39 - .../test/test_special_model_name.py | 39 - .../python-legacy/test/test_store_api.py | 61 - .../petstore/python-legacy/test/test_tag.py | 39 - .../test/test_type_holder_default.py | 49 - .../test/test_type_holder_example.py | 39 - .../petstore/python-legacy/test/test_user.py | 39 - .../python-legacy/test/test_user_api.py | 89 - .../python-legacy/test/test_xml_item.py | 39 - .../petstore/python-legacy/test_python2.sh | 31 - .../python-legacy/test_python2_and_3.sh | 31 - .../petstore/python-legacy/testfiles/foo.png | Bin 43280 -> 0 bytes .../petstore/python-legacy/tests/__init__.py | 0 .../python-legacy/tests/test_api_client.py | 197 - .../python-legacy/tests/test_api_exception.py | 87 - .../python-legacy/tests/test_configuration.py | 52 - .../tests/test_deserialization.py | 241 - .../python-legacy/tests/test_enum_arrays.py | 165 - .../python-legacy/tests/test_map_test.py | 117 - .../python-legacy/tests/test_order_model.py | 27 - .../python-legacy/tests/test_pet_api.py | 325 -- .../python-legacy/tests/test_pet_model.py | 69 - .../python-legacy/tests/test_store_api.py | 32 - .../petstore/python-legacy/tests/util.py | 8 - samples/client/petstore/python-legacy/tox.ini | 9 - .../client/petstore/python-prior/.gitignore | 66 - .../petstore/python-prior/.gitlab-ci.yml | 24 - .../python-prior/.openapi-generator-ignore | 23 - .../python-prior/.openapi-generator/FILES | 173 - .../python-prior/.openapi-generator/VERSION | 1 - .../client/petstore/python-prior/.travis.yml | 13 - samples/client/petstore/python-prior/Makefile | 18 - .../client/petstore/python-prior/README.md | 257 - .../python-prior/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesAnyType.md | 12 - .../docs/AdditionalPropertiesArray.md | 12 - .../docs/AdditionalPropertiesBoolean.md | 12 - .../docs/AdditionalPropertiesClass.md | 22 - .../docs/AdditionalPropertiesInteger.md | 12 - .../docs/AdditionalPropertiesNumber.md | 12 - .../docs/AdditionalPropertiesObject.md | 12 - .../docs/AdditionalPropertiesString.md | 12 - .../petstore/python-prior/docs/Animal.md | 13 - .../petstore/python-prior/docs/AnimalFarm.md | 11 - .../python-prior/docs/AnotherFakeApi.md | 78 - .../petstore/python-prior/docs/ApiResponse.md | 14 - .../docs/ArrayOfArrayOfNumberOnly.md | 12 - .../python-prior/docs/ArrayOfNumberOnly.md | 12 - .../petstore/python-prior/docs/ArrayTest.md | 14 - .../python-prior/docs/Capitalization.md | 17 - .../client/petstore/python-prior/docs/Cat.md | 14 - .../petstore/python-prior/docs/CatAllOf.md | 12 - .../petstore/python-prior/docs/Category.md | 13 - .../petstore/python-prior/docs/Child.md | 14 - .../petstore/python-prior/docs/ChildAllOf.md | 12 - .../petstore/python-prior/docs/ChildCat.md | 13 - .../python-prior/docs/ChildCatAllOf.md | 12 - .../petstore/python-prior/docs/ChildDog.md | 13 - .../python-prior/docs/ChildDogAllOf.md | 12 - .../petstore/python-prior/docs/ChildLizard.md | 13 - .../python-prior/docs/ChildLizardAllOf.md | 12 - .../petstore/python-prior/docs/ClassModel.md | 13 - .../petstore/python-prior/docs/Client.md | 12 - .../client/petstore/python-prior/docs/Dog.md | 14 - .../petstore/python-prior/docs/DogAllOf.md | 12 - .../petstore/python-prior/docs/EnumArrays.md | 13 - .../petstore/python-prior/docs/EnumClass.md | 11 - .../petstore/python-prior/docs/EnumTest.md | 16 - .../petstore/python-prior/docs/FakeApi.md | 1239 ----- .../docs/FakeClassnameTags123Api.md | 89 - .../client/petstore/python-prior/docs/File.md | 13 - .../python-prior/docs/FileSchemaTestClass.md | 13 - .../petstore/python-prior/docs/FormatTest.md | 24 - .../petstore/python-prior/docs/Grandparent.md | 12 - .../python-prior/docs/GrandparentAnimal.md | 12 - .../python-prior/docs/HasOnlyReadOnly.md | 13 - .../client/petstore/python-prior/docs/List.md | 12 - .../petstore/python-prior/docs/MapTest.md | 15 - ...dPropertiesAndAdditionalPropertiesClass.md | 14 - .../python-prior/docs/Model200Response.md | 14 - .../petstore/python-prior/docs/ModelReturn.md | 13 - .../python-prior/docs/Model_200Response.md | 14 - .../python-prior/docs/Model_Return.md | 13 - .../client/petstore/python-prior/docs/Name.md | 16 - .../petstore/python-prior/docs/NumberOnly.md | 12 - .../docs/NumberWithValidations.md | 11 - .../docs/ObjectModelWithRefProps.md | 15 - .../petstore/python-prior/docs/Order.md | 17 - .../petstore/python-prior/docs/Parent.md | 13 - .../petstore/python-prior/docs/ParentAllOf.md | 12 - .../petstore/python-prior/docs/ParentPet.md | 12 - .../client/petstore/python-prior/docs/Pet.md | 17 - .../petstore/python-prior/docs/PetApi.md | 802 ---- .../petstore/python-prior/docs/Player.md | 13 - .../petstore/python-prior/docs/Polygon.md | 14 - .../python-prior/docs/PolygonAllOf.md | 14 - .../python-prior/docs/ReadOnlyFirst.md | 13 - .../petstore/python-prior/docs/Shape.md | 13 - .../python-prior/docs/SpecialModelName.md | 12 - .../petstore/python-prior/docs/Square.md | 14 - .../petstore/python-prior/docs/SquareAllOf.md | 14 - .../petstore/python-prior/docs/StoreApi.md | 293 -- .../python-prior/docs/StringBooleanMap.md | 11 - .../petstore/python-prior/docs/StringEnum.md | 11 - .../client/petstore/python-prior/docs/Tag.md | 14 - .../petstore/python-prior/docs/Triangle.md | 14 - .../python-prior/docs/TriangleAllOf.md | 14 - .../python-prior/docs/TypeHolderDefault.md | 19 - .../python-prior/docs/TypeHolderExample.md | 17 - .../client/petstore/python-prior/docs/User.md | 19 - .../petstore/python-prior/docs/UserApi.md | 578 --- .../petstore/python-prior/docs/XmlItem.md | 40 - .../client/petstore/python-prior/git_push.sh | 57 - .../python-prior/petstore_api/__init__.py | 27 - .../python-prior/petstore_api/api/__init__.py | 3 - .../petstore_api/api/another_fake_api.py | 171 - .../python-prior/petstore_api/api/fake_api.py | 2464 ---------- .../api/fake_classname_tags123_api.py | 173 - .../api/fake_classname_tags_123_api.py | 173 - .../python-prior/petstore_api/api/pet_api.py | 1306 ------ .../petstore_api/api/store_api.py | 560 --- .../python-prior/petstore_api/api/user_api.py | 1083 ----- .../python-prior/petstore_api/api_client.py | 898 ---- .../petstore_api/apis/__init__.py | 22 - .../petstore_api/configuration.py | 518 --- .../python-prior/petstore_api/exceptions.py | 158 - .../petstore_api/model/__init__.py | 5 - .../model/additional_properties_any_type.py | 263 -- .../model/additional_properties_array.py | 263 -- .../model/additional_properties_boolean.py | 263 -- .../model/additional_properties_class.py | 303 -- .../model/additional_properties_integer.py | 263 -- .../model/additional_properties_number.py | 263 -- .../model/additional_properties_object.py | 263 -- .../model/additional_properties_string.py | 263 -- .../python-prior/petstore_api/model/animal.py | 287 -- .../petstore_api/model/animal_farm.py | 291 -- .../petstore_api/model/api_response.py | 271 -- .../model/array_of_array_of_number_only.py | 263 -- .../model/array_of_number_only.py | 263 -- .../petstore_api/model/array_test.py | 277 -- .../petstore_api/model/capitalization.py | 283 -- .../python-prior/petstore_api/model/cat.py | 333 -- .../petstore_api/model/cat_all_of.py | 263 -- .../petstore_api/model/category.py | 275 -- .../python-prior/petstore_api/model/child.py | 330 -- .../petstore_api/model/child_all_of.py | 263 -- .../petstore_api/model/child_cat.py | 329 -- .../petstore_api/model/child_cat_all_of.py | 263 -- .../petstore_api/model/child_dog.py | 329 -- .../petstore_api/model/child_dog_all_of.py | 263 -- .../petstore_api/model/child_lizard.py | 329 -- .../petstore_api/model/child_lizard_all_of.py | 263 -- .../petstore_api/model/class_model.py | 263 -- .../python-prior/petstore_api/model/client.py | 263 -- .../python-prior/petstore_api/model/dog.py | 333 -- .../petstore_api/model/dog_all_of.py | 263 -- .../petstore_api/model/enum_arrays.py | 275 -- .../petstore_api/model/enum_class.py | 283 -- .../petstore_api/model/enum_test.py | 309 -- .../python-prior/petstore_api/model/file.py | 263 -- .../model/file_schema_test_class.py | 273 -- .../petstore_api/model/format_test.py | 358 -- .../petstore_api/model/grandparent.py | 263 -- .../petstore_api/model/grandparent_animal.py | 289 -- .../petstore_api/model/has_only_read_only.py | 269 -- .../python-prior/petstore_api/model/list.py | 263 -- .../petstore_api/model/map_test.py | 285 -- ...perties_and_additional_properties_class.py | 277 -- .../petstore_api/model/model200_response.py | 267 -- .../petstore_api/model/model_200_response.py | 267 -- .../petstore_api/model/model_return.py | 263 -- .../python-prior/petstore_api/model/name.py | 283 -- .../petstore_api/model/number_only.py | 263 -- .../model/number_with_validations.py | 290 -- .../model/object_model_with_ref_props.py | 277 -- .../python-prior/petstore_api/model/order.py | 288 -- .../python-prior/petstore_api/model/parent.py | 326 -- .../petstore_api/model/parent_all_of.py | 263 -- .../petstore_api/model/parent_pet.py | 332 -- .../python-prior/petstore_api/model/pet.py | 304 -- .../python-prior/petstore_api/model/player.py | 273 -- .../petstore_api/model/polygon.py | 334 -- .../petstore_api/model/polygon_all_of.py | 281 -- .../petstore_api/model/read_only_first.py | 268 -- .../python-prior/petstore_api/model/shape.py | 277 -- .../petstore_api/model/special_model_name.py | 263 -- .../python-prior/petstore_api/model/square.py | 335 -- .../petstore_api/model/square_all_of.py | 274 -- .../petstore_api/model/string_boolean_map.py | 259 -- .../petstore_api/model/string_enum.py | 291 -- .../python-prior/petstore_api/model/tag.py | 271 -- .../petstore_api/model/triangle.py | 335 -- .../petstore_api/model/triangle_all_of.py | 274 -- .../petstore_api/model/type_holder_default.py | 309 -- .../petstore_api/model/type_holder_example.py | 308 -- .../python-prior/petstore_api/model/user.py | 291 -- .../petstore_api/model/xml_item.py | 375 -- .../python-prior/petstore_api/model_utils.py | 2058 -------- .../petstore_api/models/__init__.py | 81 - .../python-prior/petstore_api/rest.py | 356 -- samples/client/petstore/python-prior/pom.xml | 46 - .../petstore/python-prior/requirements.txt | 3 - .../client/petstore/python-prior/setup.cfg | 2 - samples/client/petstore/python-prior/setup.py | 43 - .../python-prior/test-requirements.txt | 1 - .../petstore/python-prior/test/__init__.py | 0 .../test_additional_properties_any_type.py | 38 - .../test/test_additional_properties_array.py | 50 - .../test_additional_properties_boolean.py | 45 - .../test/test_additional_properties_class.py | 38 - .../test_additional_properties_integer.py | 45 - .../test/test_additional_properties_number.py | 45 - .../test/test_additional_properties_object.py | 50 - .../test/test_additional_properties_string.py | 45 - .../petstore/python-prior/test/test_animal.py | 48 - .../python-prior/test/test_animal_farm.py | 43 - .../test/test_another_fake_api.py | 39 - .../python-prior/test/test_api_response.py | 38 - .../test_array_of_array_of_number_only.py | 38 - .../test/test_array_of_number_only.py | 38 - .../python-prior/test/test_array_test.py | 43 - .../python-prior/test/test_capitalization.py | 38 - .../petstore/python-prior/test/test_cat.py | 48 - .../python-prior/test/test_cat_all_of.py | 38 - .../python-prior/test/test_category.py | 38 - .../petstore/python-prior/test/test_child.py | 154 - .../python-prior/test/test_child_all_of.py | 38 - .../python-prior/test/test_child_cat.py | 48 - .../test/test_child_cat_all_of.py | 38 - .../python-prior/test/test_child_dog.py | 48 - .../test/test_child_dog_all_of.py | 38 - .../python-prior/test/test_child_lizard.py | 48 - .../test/test_child_lizard_all_of.py | 38 - .../python-prior/test/test_class_model.py | 38 - .../petstore/python-prior/test/test_client.py | 38 - .../petstore/python-prior/test/test_dog.py | 151 - .../python-prior/test/test_dog_all_of.py | 38 - .../python-prior/test/test_enum_arrays.py | 162 - .../python-prior/test/test_enum_class.py | 38 - .../python-prior/test/test_enum_test.py | 43 - .../python-prior/test/test_fake_api.py | 200 - .../test/test_fake_classname_tags123_api.py | 35 - .../test/test_fake_classname_tags_123_api.py | 39 - .../petstore/python-prior/test/test_file.py | 38 - .../test/test_file_schema_test_class.py | 43 - .../python-prior/test/test_format_test.py | 153 - .../python-prior/test/test_grandparent.py | 38 - .../test/test_grandparent_animal.py | 58 - .../test/test_has_only_read_only.py | 38 - .../petstore/python-prior/test/test_list.py | 38 - .../python-prior/test/test_map_test.py | 125 - ...perties_and_additional_properties_class.py | 43 - .../test/test_model200_response.py | 38 - .../test/test_model_200_response.py | 35 - .../python-prior/test/test_model_return.py | 38 - .../petstore/python-prior/test/test_name.py | 38 - .../python-prior/test/test_number_only.py | 38 - .../test/test_number_with_validations.py | 45 - .../test/test_object_model_with_ref_props.py | 49 - .../petstore/python-prior/test/test_order.py | 41 - .../petstore/python-prior/test/test_parent.py | 48 - .../python-prior/test/test_parent_all_of.py | 38 - .../python-prior/test/test_parent_pet.py | 58 - .../petstore/python-prior/test/test_pet.py | 89 - .../python-prior/test/test_pet_api.py | 95 - .../petstore/python-prior/test/test_player.py | 44 - .../python-prior/test/test_polygon.py | 39 - .../python-prior/test/test_polygon_all_of.py | 35 - .../python-prior/test/test_read_only_first.py | 38 - .../petstore/python-prior/test/test_shape.py | 35 - .../test/test_special_model_name.py | 38 - .../petstore/python-prior/test/test_square.py | 39 - .../python-prior/test/test_square_all_of.py | 35 - .../python-prior/test/test_store_api.py | 60 - .../test/test_string_boolean_map.py | 38 - .../python-prior/test/test_string_enum.py | 49 - .../petstore/python-prior/test/test_tag.py | 38 - .../python-prior/test/test_triangle.py | 39 - .../python-prior/test/test_triangle_all_of.py | 35 - .../test/test_type_holder_default.py | 41 - .../test/test_type_holder_example.py | 38 - .../petstore/python-prior/test/test_user.py | 38 - .../python-prior/test/test_user_api.py | 88 - .../python-prior/test/test_xml_item.py | 38 - .../petstore/python-prior/test_python.sh | 31 - .../python-prior/testfiles/1px_pic1.png | Bin 67 -> 0 bytes .../python-prior/testfiles/1px_pic2.png | Bin 67 -> 0 bytes .../petstore/python-prior/testfiles/foo.png | Bin 43280 -> 0 bytes .../petstore/python-prior/tests/__init__.py | 0 .../python-prior/tests/test_api_client.py | 231 - .../python-prior/tests/test_api_exception.py | 86 - .../tests/test_deserialization.py | 441 -- .../python-prior/tests/test_pet_api.py | 429 -- .../python-prior/tests/test_serialization.py | 78 - .../python-prior/tests/test_store_api.py | 32 - .../petstore/python-prior/tests/util.py | 8 - samples/client/petstore/python-prior/tox.ini | 9 - .../.gitignore | 66 - .../.gitlab-ci.yml | 24 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 173 - .../.openapi-generator/VERSION | 1 - .../.travis.yml | 13 - .../Makefile | 18 - .../README.md | 257 - .../dev-requirements.txt | 2 - .../docs/AdditionalPropertiesAnyType.md | 12 - .../docs/AdditionalPropertiesArray.md | 12 - .../docs/AdditionalPropertiesBoolean.md | 12 - .../docs/AdditionalPropertiesClass.md | 21 - .../docs/AdditionalPropertiesInteger.md | 12 - .../docs/AdditionalPropertiesNumber.md | 12 - .../docs/AdditionalPropertiesObject.md | 12 - .../docs/AdditionalPropertiesString.md | 12 - .../docs/Animal.md | 12 - .../docs/AnimalFarm.md | 11 - .../docs/AnotherFakeApi.md | 78 - .../docs/ApiResponse.md | 13 - .../docs/ArrayOfArrayOfNumberOnly.md | 11 - .../docs/ArrayOfNumberOnly.md | 11 - .../docs/ArrayTest.md | 13 - .../docs/Capitalization.md | 16 - .../docs/Cat.md | 13 - .../docs/CatAllOf.md | 11 - .../docs/Category.md | 12 - .../docs/Child.md | 13 - .../docs/ChildAllOf.md | 11 - .../docs/ChildCat.md | 12 - .../docs/ChildCatAllOf.md | 11 - .../docs/ChildDog.md | 12 - .../docs/ChildDogAllOf.md | 11 - .../docs/ChildLizard.md | 12 - .../docs/ChildLizardAllOf.md | 11 - .../docs/ClassModel.md | 12 - .../docs/Client.md | 11 - .../docs/Dog.md | 13 - .../docs/DogAllOf.md | 11 - .../docs/EnumArrays.md | 12 - .../docs/EnumClass.md | 11 - .../docs/EnumTest.md | 15 - .../docs/FakeApi.md | 1239 ----- .../docs/FakeClassnameTags123Api.md | 89 - .../docs/File.md | 12 - .../docs/FileSchemaTestClass.md | 12 - .../docs/FormatTest.md | 23 - .../docs/Grandparent.md | 11 - .../docs/GrandparentAnimal.md | 11 - .../docs/HasOnlyReadOnly.md | 12 - .../docs/List.md | 11 - .../docs/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../docs/Model200Response.md | 13 - .../docs/ModelReturn.md | 12 - .../docs/Model_200Response.md | 13 - .../docs/Model_Return.md | 12 - .../docs/Name.md | 15 - .../docs/NumberOnly.md | 11 - .../docs/NumberWithValidations.md | 11 - .../docs/ObjectModelWithRefProps.md | 14 - .../docs/Order.md | 16 - .../docs/Parent.md | 12 - .../docs/ParentAllOf.md | 11 - .../docs/ParentPet.md | 11 - .../docs/Pet.md | 16 - .../docs/PetApi.md | 802 ---- .../docs/Player.md | 12 - .../docs/Polygon.md | 13 - .../docs/PolygonAllOf.md | 13 - .../docs/ReadOnlyFirst.md | 12 - .../docs/Shape.md | 12 - .../docs/SpecialModelName.md | 11 - .../docs/Square.md | 13 - .../docs/SquareAllOf.md | 13 - .../docs/StoreApi.md | 293 -- .../docs/StringBooleanMap.md | 11 - .../docs/StringEnum.md | 11 - .../docs/Tag.md | 13 - .../docs/Triangle.md | 13 - .../docs/TriangleAllOf.md | 13 - .../docs/TypeHolderDefault.md | 18 - .../docs/TypeHolderExample.md | 16 - .../docs/User.md | 18 - .../docs/UserApi.md | 578 --- .../docs/XmlItem.md | 39 - .../git_push.sh | 57 - .../petstore_api/__init__.py | 27 - .../petstore_api/api/__init__.py | 3 - .../petstore_api/api/another_fake_api.py | 171 - .../petstore_api/api/fake_api.py | 2464 ---------- .../api/fake_classname_tags123_api.py | 173 - .../api/fake_classname_tags_123_api.py | 173 - .../petstore_api/api/pet_api.py | 1306 ------ .../petstore_api/api/store_api.py | 560 --- .../petstore_api/api/user_api.py | 1083 ----- .../petstore_api/api_client.py | 898 ---- .../petstore_api/apis/__init__.py | 22 - .../petstore_api/configuration.py | 518 --- .../petstore_api/exceptions.py | 158 - .../petstore_api/model/__init__.py | 5 - .../model/additional_properties_any_type.py | 263 -- .../model/additional_properties_array.py | 263 -- .../model/additional_properties_boolean.py | 263 -- .../model/additional_properties_class.py | 297 -- .../model/additional_properties_integer.py | 263 -- .../model/additional_properties_number.py | 263 -- .../model/additional_properties_object.py | 263 -- .../model/additional_properties_string.py | 263 -- .../petstore_api/model/animal.py | 280 -- .../petstore_api/model/animal_farm.py | 291 -- .../petstore_api/model/api_response.py | 265 -- .../model/array_of_array_of_number_only.py | 257 - .../model/array_of_number_only.py | 257 - .../petstore_api/model/array_test.py | 270 -- .../petstore_api/model/capitalization.py | 277 -- .../petstore_api/model/cat.py | 326 -- .../petstore_api/model/cat_all_of.py | 257 - .../petstore_api/model/category.py | 269 -- .../petstore_api/model/child.py | 323 -- .../petstore_api/model/child_all_of.py | 257 - .../petstore_api/model/child_cat.py | 322 -- .../petstore_api/model/child_cat_all_of.py | 257 - .../petstore_api/model/child_dog.py | 322 -- .../petstore_api/model/child_dog_all_of.py | 257 - .../petstore_api/model/child_lizard.py | 322 -- .../petstore_api/model/child_lizard_all_of.py | 257 - .../petstore_api/model/class_model.py | 257 - .../petstore_api/model/client.py | 257 - .../petstore_api/model/dog.py | 326 -- .../petstore_api/model/dog_all_of.py | 257 - .../petstore_api/model/enum_arrays.py | 269 -- .../petstore_api/model/enum_class.py | 283 -- .../petstore_api/model/enum_test.py | 302 -- .../petstore_api/model/file.py | 257 - .../model/file_schema_test_class.py | 266 -- .../petstore_api/model/format_test.py | 352 -- .../petstore_api/model/grandparent.py | 257 - .../petstore_api/model/grandparent_animal.py | 282 -- .../petstore_api/model/has_only_read_only.py | 263 -- .../petstore_api/model/list.py | 257 - .../petstore_api/model/map_test.py | 278 -- ...perties_and_additional_properties_class.py | 270 -- .../petstore_api/model/model200_response.py | 261 -- .../petstore_api/model/model_200_response.py | 261 -- .../petstore_api/model/model_return.py | 257 - .../petstore_api/model/name.py | 277 -- .../petstore_api/model/number_only.py | 257 - .../model/number_with_validations.py | 290 -- .../model/object_model_with_ref_props.py | 270 -- .../petstore_api/model/order.py | 282 -- .../petstore_api/model/parent.py | 319 -- .../petstore_api/model/parent_all_of.py | 257 - .../petstore_api/model/parent_pet.py | 325 -- .../petstore_api/model/pet.py | 297 -- .../petstore_api/model/player.py | 267 -- .../petstore_api/model/polygon.py | 327 -- .../petstore_api/model/polygon_all_of.py | 275 -- .../petstore_api/model/read_only_first.py | 262 -- .../petstore_api/model/shape.py | 271 -- .../petstore_api/model/special_model_name.py | 257 - .../petstore_api/model/square.py | 328 -- .../petstore_api/model/square_all_of.py | 268 -- .../petstore_api/model/string_boolean_map.py | 259 -- .../petstore_api/model/string_enum.py | 291 -- .../petstore_api/model/tag.py | 265 -- .../petstore_api/model/triangle.py | 328 -- .../petstore_api/model/triangle_all_of.py | 268 -- .../petstore_api/model/type_holder_default.py | 303 -- .../petstore_api/model/type_holder_example.py | 302 -- .../petstore_api/model/user.py | 285 -- .../petstore_api/model/xml_item.py | 369 -- .../petstore_api/model_utils.py | 2058 -------- .../petstore_api/models/__init__.py | 81 - .../petstore_api/rest.py | 356 -- .../pom.xml | 46 - .../requirements.txt | 3 - .../setup.cfg | 2 - .../setup.py | 43 - .../test-requirements.txt | 1 - .../test/__init__.py | 0 .../test_additional_properties_any_type.py | 38 - .../test/test_additional_properties_array.py | 50 - .../test_additional_properties_boolean.py | 45 - .../test/test_additional_properties_class.py | 38 - .../test_additional_properties_integer.py | 45 - .../test/test_additional_properties_number.py | 45 - .../test/test_additional_properties_object.py | 50 - .../test/test_additional_properties_string.py | 45 - .../test/test_animal.py | 48 - .../test/test_animal_farm.py | 43 - .../test/test_another_fake_api.py | 39 - .../test/test_api_response.py | 38 - .../test_array_of_array_of_number_only.py | 38 - .../test/test_array_of_number_only.py | 38 - .../test/test_array_test.py | 43 - .../test/test_capitalization.py | 38 - .../test/test_cat.py | 48 - .../test/test_cat_all_of.py | 38 - .../test/test_category.py | 38 - .../test/test_child.py | 57 - .../test/test_child_all_of.py | 38 - .../test/test_child_cat.py | 48 - .../test/test_child_cat_all_of.py | 38 - .../test/test_child_dog.py | 48 - .../test/test_child_dog_all_of.py | 38 - .../test/test_child_lizard.py | 48 - .../test/test_child_lizard_all_of.py | 38 - .../test/test_class_model.py | 38 - .../test/test_client.py | 38 - .../test/test_dog.py | 57 - .../test/test_dog_all_of.py | 38 - .../test/test_enum_arrays.py | 162 - .../test/test_enum_class.py | 38 - .../test/test_enum_test.py | 43 - .../test/test_fake_api.py | 200 - .../test/test_fake_classname_tags123_api.py | 35 - .../test/test_fake_classname_tags_123_api.py | 39 - .../test/test_file.py | 38 - .../test/test_file_schema_test_class.py | 43 - .../test/test_format_test.py | 153 - .../test/test_grandparent.py | 38 - .../test/test_grandparent_animal.py | 58 - .../test/test_has_only_read_only.py | 38 - .../test/test_list.py | 38 - .../test/test_map_test.py | 125 - ...perties_and_additional_properties_class.py | 43 - .../test/test_model200_response.py | 38 - .../test/test_model_200_response.py | 35 - .../test/test_model_return.py | 38 - .../test/test_name.py | 38 - .../test/test_number_only.py | 38 - .../test/test_number_with_validations.py | 45 - .../test/test_object_model_with_ref_props.py | 49 - .../test/test_order.py | 41 - .../test/test_parent.py | 48 - .../test/test_parent_all_of.py | 38 - .../test/test_parent_pet.py | 58 - .../test/test_pet.py | 89 - .../test/test_pet_api.py | 95 - .../test/test_player.py | 44 - .../test/test_polygon.py | 39 - .../test/test_polygon_all_of.py | 35 - .../test/test_read_only_first.py | 38 - .../test/test_shape.py | 35 - .../test/test_special_model_name.py | 38 - .../test/test_square.py | 39 - .../test/test_square_all_of.py | 35 - .../test/test_store_api.py | 60 - .../test/test_string_boolean_map.py | 38 - .../test/test_string_enum.py | 49 - .../test/test_tag.py | 38 - .../test/test_triangle.py | 39 - .../test/test_triangle_all_of.py | 35 - .../test/test_type_holder_default.py | 41 - .../test/test_type_holder_example.py | 38 - .../test/test_user.py | 38 - .../test/test_user_api.py | 88 - .../test/test_xml_item.py | 38 - .../test_python.sh | 31 - .../testfiles/1px_pic1.png | Bin 67 -> 0 bytes .../testfiles/1px_pic2.png | Bin 67 -> 0 bytes .../testfiles/foo.png | Bin 43280 -> 0 bytes .../tests/__init__.py | 0 .../tests/test_api_client.py | 221 - .../tests/test_api_exception.py | 86 - .../tests/test_deserialization.py | 442 -- .../tests/test_pet_api.py | 406 -- .../tests/test_serialization.py | 78 - .../tests/test_store_api.py | 32 - .../tests/util.py | 8 - .../tox.ini | 9 - .../client/petstore/python-tornado/.gitignore | 66 - .../petstore/python-tornado/.gitlab-ci.yml | 33 - .../python-tornado/.openapi-generator-ignore | 23 - .../python-tornado/.openapi-generator/FILES | 126 - .../python-tornado/.openapi-generator/VERSION | 1 - .../petstore/python-tornado/.travis.yml | 17 - .../client/petstore/python-tornado/Makefile | 18 - .../client/petstore/python-tornado/README.md | 214 - .../python-tornado/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesAnyType.md | 11 - .../docs/AdditionalPropertiesArray.md | 11 - .../docs/AdditionalPropertiesBoolean.md | 11 - .../docs/AdditionalPropertiesClass.md | 21 - .../docs/AdditionalPropertiesInteger.md | 11 - .../docs/AdditionalPropertiesNumber.md | 11 - .../docs/AdditionalPropertiesObject.md | 11 - .../docs/AdditionalPropertiesString.md | 11 - .../petstore/python-tornado/docs/Animal.md | 12 - .../python-tornado/docs/AnotherFakeApi.md | 71 - .../python-tornado/docs/ApiResponse.md | 13 - .../docs/ArrayOfArrayOfNumberOnly.md | 11 - .../python-tornado/docs/ArrayOfNumberOnly.md | 11 - .../petstore/python-tornado/docs/ArrayTest.md | 13 - .../petstore/python-tornado/docs/BigCat.md | 11 - .../python-tornado/docs/BigCatAllOf.md | 11 - .../python-tornado/docs/Capitalization.md | 16 - .../petstore/python-tornado/docs/Cat.md | 11 - .../petstore/python-tornado/docs/CatAllOf.md | 11 - .../petstore/python-tornado/docs/Category.md | 12 - .../python-tornado/docs/ClassModel.md | 12 - .../petstore/python-tornado/docs/Client.md | 11 - .../petstore/python-tornado/docs/Dog.md | 11 - .../petstore/python-tornado/docs/DogAllOf.md | 11 - .../python-tornado/docs/EnumArrays.md | 12 - .../petstore/python-tornado/docs/EnumClass.md | 10 - .../petstore/python-tornado/docs/EnumTest.md | 15 - .../petstore/python-tornado/docs/FakeApi.md | 943 ---- .../docs/FakeClassnameTags123Api.md | 82 - .../petstore/python-tornado/docs/File.md | 12 - .../docs/FileSchemaTestClass.md | 12 - .../python-tornado/docs/FormatTest.md | 24 - .../python-tornado/docs/HasOnlyReadOnly.md | 12 - .../petstore/python-tornado/docs/List.md | 11 - .../petstore/python-tornado/docs/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../python-tornado/docs/Model200Response.md | 13 - .../python-tornado/docs/ModelReturn.md | 12 - .../python-tornado/docs/Model_200Response.md | 13 - .../python-tornado/docs/Model_Return.md | 12 - .../petstore/python-tornado/docs/Name.md | 15 - .../python-tornado/docs/NumberOnly.md | 11 - .../petstore/python-tornado/docs/Order.md | 16 - .../python-tornado/docs/OuterComposite.md | 13 - .../petstore/python-tornado/docs/OuterEnum.md | 10 - .../petstore/python-tornado/docs/Pet.md | 16 - .../petstore/python-tornado/docs/PetApi.md | 681 --- .../python-tornado/docs/ReadOnlyFirst.md | 12 - .../python-tornado/docs/SpecialModelName.md | 11 - .../petstore/python-tornado/docs/StoreApi.md | 268 -- .../petstore/python-tornado/docs/Tag.md | 12 - .../python-tornado/docs/TypeHolderDefault.md | 15 - .../python-tornado/docs/TypeHolderExample.md | 16 - .../petstore/python-tornado/docs/User.md | 18 - .../petstore/python-tornado/docs/UserApi.md | 501 -- .../petstore/python-tornado/docs/XmlItem.md | 39 - .../petstore/python-tornado/git_push.sh | 57 - .../python-tornado/petstore_api/__init__.py | 85 - .../petstore_api/api/__init__.py | 11 - .../petstore_api/api/another_fake_api.py | 182 - .../petstore_api/api/fake_api.py | 2230 --------- .../api/fake_classname_tags123_api.py | 182 - .../api/fake_classname_tags_123_api.py | 181 - .../petstore_api/api/pet_api.py | 1332 ------ .../petstore_api/api/store_api.py | 574 --- .../petstore_api/api/user_api.py | 1100 ----- .../python-tornado/petstore_api/api_client.py | 703 --- .../petstore_api/configuration.py | 522 --- .../python-tornado/petstore_api/exceptions.py | 163 - .../petstore_api/models/__init__.py | 64 - .../models/additional_properties_any_type.py | 131 - .../models/additional_properties_array.py | 131 - .../models/additional_properties_boolean.py | 131 - .../models/additional_properties_class.py | 391 -- .../models/additional_properties_integer.py | 131 - .../models/additional_properties_number.py | 131 - .../models/additional_properties_object.py | 131 - .../models/additional_properties_string.py | 131 - .../petstore_api/models/animal.py | 170 - .../petstore_api/models/api_response.py | 183 - .../models/array_of_array_of_number_only.py | 131 - .../models/array_of_number_only.py | 131 - .../petstore_api/models/array_test.py | 183 - .../petstore_api/models/big_cat.py | 137 - .../petstore_api/models/big_cat_all_of.py | 137 - .../petstore_api/models/capitalization.py | 263 -- .../python-tornado/petstore_api/models/cat.py | 131 - .../petstore_api/models/cat_all_of.py | 131 - .../petstore_api/models/category.py | 158 - .../petstore_api/models/class_model.py | 131 - .../petstore_api/models/client.py | 131 - .../python-tornado/petstore_api/models/dog.py | 131 - .../petstore_api/models/dog_all_of.py | 131 - .../petstore_api/models/enum_arrays.py | 171 - .../petstore_api/models/enum_class.py | 112 - .../petstore_api/models/enum_test.py | 260 -- .../petstore_api/models/file.py | 133 - .../models/file_schema_test_class.py | 157 - .../petstore_api/models/format_test.py | 515 -- .../petstore_api/models/has_only_read_only.py | 157 - .../petstore_api/models/list.py | 131 - .../petstore_api/models/map_test.py | 217 - ...perties_and_additional_properties_class.py | 183 - .../petstore_api/models/model200_response.py | 157 - .../petstore_api/models/model_200_response.py | 157 - .../petstore_api/models/model_return.py | 131 - .../petstore_api/models/name.py | 210 - .../petstore_api/models/number_only.py | 131 - .../petstore_api/models/order.py | 269 -- .../petstore_api/models/outer_composite.py | 183 - .../petstore_api/models/outer_enum.py | 112 - .../python-tornado/petstore_api/models/pet.py | 271 -- .../petstore_api/models/read_only_first.py | 157 - .../petstore_api/models/special_model_name.py | 131 - .../python-tornado/petstore_api/models/tag.py | 157 - .../models/type_holder_default.py | 240 - .../models/type_holder_example.py | 267 -- .../petstore_api/models/user.py | 315 -- .../petstore_api/models/xml_item.py | 859 ---- .../python-tornado/petstore_api/rest.py | 232 - .../client/petstore/python-tornado/pom.xml | 46 - .../petstore/python-tornado/requirements.txt | 5 - .../client/petstore/python-tornado/setup.cfg | 2 - .../client/petstore/python-tornado/setup.py | 43 - .../python-tornado/test-requirements.txt | 3 - .../petstore/python-tornado/test/__init__.py | 0 .../test_additional_properties_any_type.py | 39 - .../test/test_additional_properties_array.py | 39 - .../test_additional_properties_boolean.py | 39 - .../test/test_additional_properties_class.py | 39 - .../test_additional_properties_integer.py | 39 - .../test/test_additional_properties_number.py | 39 - .../test/test_additional_properties_object.py | 39 - .../test/test_additional_properties_string.py | 39 - .../python-tornado/test/test_animal.py | 39 - .../test/test_another_fake_api.py | 40 - .../python-tornado/test/test_api_response.py | 39 - .../test_array_of_array_of_number_only.py | 39 - .../test/test_array_of_number_only.py | 39 - .../python-tornado/test/test_array_test.py | 39 - .../python-tornado/test/test_big_cat.py | 39 - .../test/test_big_cat_all_of.py | 39 - .../test/test_capitalization.py | 39 - .../petstore/python-tornado/test/test_cat.py | 39 - .../python-tornado/test/test_cat_all_of.py | 39 - .../python-tornado/test/test_category.py | 39 - .../python-tornado/test/test_class_model.py | 39 - .../python-tornado/test/test_client.py | 39 - .../petstore/python-tornado/test/test_dog.py | 39 - .../python-tornado/test/test_dog_all_of.py | 39 - .../python-tornado/test/test_enum_arrays.py | 39 - .../python-tornado/test/test_enum_class.py | 39 - .../python-tornado/test/test_enum_test.py | 39 - .../python-tornado/test/test_fake_api.py | 98 - .../test/test_fake_classname_tags123_api.py | 40 - .../test/test_fake_classname_tags_123_api.py | 40 - .../petstore/python-tornado/test/test_file.py | 39 - .../test/test_file_schema_test_class.py | 39 - .../python-tornado/test/test_format_test.py | 39 - .../test/test_has_only_read_only.py | 39 - .../petstore/python-tornado/test/test_list.py | 39 - .../python-tornado/test/test_map_test.py | 39 - ...perties_and_additional_properties_class.py | 39 - .../test/test_model200_response.py | 39 - .../test/test_model_200_response.py | 52 - .../python-tornado/test/test_model_return.py | 39 - .../petstore/python-tornado/test/test_name.py | 39 - .../python-tornado/test/test_number_only.py | 39 - .../python-tornado/test/test_order.py | 39 - .../test/test_outer_composite.py | 39 - .../python-tornado/test/test_outer_enum.py | 39 - .../petstore/python-tornado/test/test_pet.py | 39 - .../python-tornado/test/test_pet_api.py | 89 - .../test/test_read_only_first.py | 39 - .../test/test_special_model_name.py | 39 - .../python-tornado/test/test_store_api.py | 61 - .../petstore/python-tornado/test/test_tag.py | 39 - .../test/test_type_holder_default.py | 39 - .../test/test_type_holder_example.py | 39 - .../petstore/python-tornado/test/test_user.py | 39 - .../python-tornado/test/test_user_api.py | 89 - .../python-tornado/test/test_xml_item.py | 39 - .../python-tornado/test_python2_and_3.sh | 31 - .../petstore/python-tornado/testfiles/foo.png | Bin 43280 -> 0 bytes .../petstore/python-tornado/tests/__init__.py | 0 .../python-tornado/tests/test_pet_api.py | 220 - .../petstore/python-tornado/tests/util.py | 8 - .../client/petstore/python-tornado/tox.ini | 9 - .../x-auth-id-alias/python-prior/.gitignore | 66 - .../python-prior/.gitlab-ci.yml | 24 - .../python-prior/.openapi-generator-ignore | 23 - .../python-prior/.openapi-generator/FILES | 23 - .../python-prior/.openapi-generator/VERSION | 1 - .../x-auth-id-alias/python-prior/.travis.yml | 13 - .../x-auth-id-alias/python-prior/README.md | 149 - .../python-prior/docs/UsageApi.md | 318 -- .../x-auth-id-alias/python-prior/git_push.sh | 57 - .../python-prior/requirements.txt | 3 - .../x-auth-id-alias/python-prior/setup.cfg | 2 - .../x-auth-id-alias/python-prior/setup.py | 43 - .../python-prior/test-requirements.txt | 1 - .../python-prior/test/__init__.py | 0 .../python-prior/test/test_usage_api.py | 56 - .../python-prior/tests/test_api_keys.py | 102 - .../x-auth-id-alias/python-prior/tox.ini | 9 - .../python-prior/x_auth_id_alias/__init__.py | 27 - .../x_auth_id_alias/api/__init__.py | 3 - .../x_auth_id_alias/api/usage_api.py | 527 --- .../x_auth_id_alias/api_client.py | 898 ---- .../x_auth_id_alias/apis/__init__.py | 17 - .../x_auth_id_alias/configuration.py | 522 --- .../x_auth_id_alias/exceptions.py | 158 - .../x_auth_id_alias/model/__init__.py | 5 - .../x_auth_id_alias/model_utils.py | 2058 -------- .../x_auth_id_alias/models/__init__.py | 11 - .../python-prior/x_auth_id_alias/rest.py | 356 -- .../.openapi-generator/VERSION | 1 - .../client/petstore/python-legacy/.gitignore | 66 - .../petstore/python-legacy/.gitlab-ci.yml | 33 - .../python-legacy/.openapi-generator-ignore | 23 - .../python-legacy/.openapi-generator/FILES | 128 - .../python-legacy/.openapi-generator/VERSION | 1 - .../client/petstore/python-legacy/.travis.yml | 17 - .../client/petstore/python-legacy/Makefile | 21 - .../client/petstore/python-legacy/README.md | 227 - .../python-legacy/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesClass.md | 12 - .../python-legacy/docs/AllOfWithSingleRef.md | 12 - .../petstore/python-legacy/docs/Animal.md | 12 - .../python-legacy/docs/AnotherFakeApi.md | 71 - .../python-legacy/docs/ApiResponse.md | 13 - .../docs/ArrayOfArrayOfNumberOnly.md | 11 - .../python-legacy/docs/ArrayOfNumberOnly.md | 11 - .../petstore/python-legacy/docs/ArrayTest.md | 13 - .../python-legacy/docs/Capitalization.md | 16 - .../client/petstore/python-legacy/docs/Cat.md | 11 - .../petstore/python-legacy/docs/CatAllOf.md | 11 - .../petstore/python-legacy/docs/Category.md | 12 - .../petstore/python-legacy/docs/ClassModel.md | 12 - .../petstore/python-legacy/docs/Client.md | 11 - .../petstore/python-legacy/docs/DefaultApi.md | 64 - .../python-legacy/docs/DeprecatedObject.md | 11 - .../client/petstore/python-legacy/docs/Dog.md | 11 - .../petstore/python-legacy/docs/DogAllOf.md | 11 - .../petstore/python-legacy/docs/EnumArrays.md | 12 - .../petstore/python-legacy/docs/EnumClass.md | 10 - .../petstore/python-legacy/docs/EnumTest.md | 18 - .../petstore/python-legacy/docs/FakeApi.md | 1209 ----- .../docs/FakeClassnameTags123Api.md | 82 - .../petstore/python-legacy/docs/File.md | 12 - .../python-legacy/docs/FileSchemaTestClass.md | 12 - .../client/petstore/python-legacy/docs/Foo.md | 11 - .../docs/FooGetDefaultResponse.md | 11 - .../petstore/python-legacy/docs/FormatTest.md | 26 - .../python-legacy/docs/HasOnlyReadOnly.md | 12 - .../python-legacy/docs/HealthCheckResult.md | 12 - .../python-legacy/docs/InlineObject.md | 11 - .../python-legacy/docs/InlineObject1.md | 11 - .../python-legacy/docs/InlineObject2.md | 11 - .../python-legacy/docs/InlineObject3.md | 23 - .../python-legacy/docs/InlineObject4.md | 11 - .../python-legacy/docs/InlineObject5.md | 11 - .../docs/InlineResponseDefault.md | 11 - .../petstore/python-legacy/docs/List.md | 11 - .../petstore/python-legacy/docs/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../python-legacy/docs/Model200Response.md | 13 - .../python-legacy/docs/ModelReturn.md | 12 - .../python-legacy/docs/Model_200Response.md | 13 - .../python-legacy/docs/Model_Return.md | 12 - .../petstore/python-legacy/docs/Name.md | 15 - .../python-legacy/docs/NullableClass.md | 22 - .../petstore/python-legacy/docs/NumberOnly.md | 11 - .../docs/ObjectWithDeprecatedFields.md | 14 - .../petstore/python-legacy/docs/Order.md | 16 - .../python-legacy/docs/OuterComposite.md | 13 - .../petstore/python-legacy/docs/OuterEnum.md | 10 - .../docs/OuterEnumDefaultValue.md | 10 - .../python-legacy/docs/OuterEnumInteger.md | 10 - .../docs/OuterEnumIntegerDefaultValue.md | 10 - .../docs/OuterObjectWithEnumProperty.md | 11 - .../client/petstore/python-legacy/docs/Pet.md | 16 - .../petstore/python-legacy/docs/PetApi.md | 694 --- .../python-legacy/docs/ReadOnlyFirst.md | 12 - .../python-legacy/docs/SingleRefType.md | 10 - .../python-legacy/docs/SpecialModelName.md | 11 - .../petstore/python-legacy/docs/StoreApi.md | 270 -- .../client/petstore/python-legacy/docs/Tag.md | 12 - .../petstore/python-legacy/docs/User.md | 18 - .../petstore/python-legacy/docs/UserApi.md | 511 -- .../client/petstore/python-legacy/git_push.sh | 57 - .../python-legacy/petstore_api/__init__.py | 86 - .../petstore_api/api/__init__.py | 12 - .../petstore_api/api/another_fake_api.py | 182 - .../petstore_api/api/default_api.py | 161 - .../petstore_api/api/fake_api.py | 2709 ----------- .../api/fake_classname_tags123_api.py | 182 - .../api/fake_classname_tags_123_api.py | 181 - .../python-legacy/petstore_api/api/pet_api.py | 1374 ------ .../petstore_api/api/store_api.py | 584 --- .../petstore_api/api/user_api.py | 1142 ----- .../python-legacy/petstore_api/api_client.py | 701 --- .../petstore_api/configuration.py | 625 --- .../python-legacy/petstore_api/exceptions.py | 163 - .../petstore_api/models/__init__.py | 64 - .../models/additional_properties_class.py | 157 - .../models/all_of_with_single_ref.py | 157 - .../petstore_api/models/animal.py | 169 - .../petstore_api/models/api_response.py | 183 - .../models/array_of_array_of_number_only.py | 131 - .../models/array_of_number_only.py | 131 - .../petstore_api/models/array_test.py | 189 - .../petstore_api/models/capitalization.py | 263 -- .../python-legacy/petstore_api/models/cat.py | 131 - .../petstore_api/models/cat_all_of.py | 131 - .../petstore_api/models/category.py | 158 - .../petstore_api/models/class_model.py | 131 - .../petstore_api/models/client.py | 131 - .../petstore_api/models/deprecated_object.py | 131 - .../python-legacy/petstore_api/models/dog.py | 131 - .../petstore_api/models/dog_all_of.py | 131 - .../petstore_api/models/enum_arrays.py | 171 - .../petstore_api/models/enum_class.py | 112 - .../petstore_api/models/enum_test.py | 337 -- .../python-legacy/petstore_api/models/file.py | 133 - .../models/file_schema_test_class.py | 157 - .../python-legacy/petstore_api/models/foo.py | 131 - .../models/foo_get_default_response.py | 131 - .../petstore_api/models/format_test.py | 574 --- .../petstore_api/models/has_only_read_only.py | 157 - .../models/health_check_result.py | 130 - .../petstore_api/models/inline_object.py | 158 - .../petstore_api/models/inline_object1.py | 158 - .../petstore_api/models/inline_object2.py | 172 - .../petstore_api/models/inline_object3.py | 537 --- .../petstore_api/models/inline_object4.py | 160 - .../petstore_api/models/inline_object5.py | 159 - .../models/inline_response_default.py | 131 - .../python-legacy/petstore_api/models/list.py | 131 - .../petstore_api/models/map_test.py | 217 - ...perties_and_additional_properties_class.py | 183 - .../petstore_api/models/model200_response.py | 157 - .../petstore_api/models/model_200_response.py | 157 - .../petstore_api/models/model_return.py | 131 - .../python-legacy/petstore_api/models/name.py | 210 - .../petstore_api/models/nullable_class.py | 407 -- .../petstore_api/models/number_only.py | 131 - .../models/object_with_deprecated_fields.py | 209 - .../petstore_api/models/order.py | 269 -- .../petstore_api/models/outer_composite.py | 183 - .../petstore_api/models/outer_enum.py | 112 - .../models/outer_enum_default_value.py | 112 - .../petstore_api/models/outer_enum_integer.py | 112 - .../outer_enum_integer_default_value.py | 112 - .../models/outer_object_with_enum_property.py | 132 - .../python-legacy/petstore_api/models/pet.py | 271 -- .../petstore_api/models/read_only_first.py | 157 - .../petstore_api/models/single_ref_type.py | 111 - .../petstore_api/models/special_model_name.py | 131 - .../python-legacy/petstore_api/models/tag.py | 157 - .../python-legacy/petstore_api/models/user.py | 315 -- .../python-legacy/petstore_api/rest.py | 301 -- .../client/petstore/python-legacy/pom.xml | 46 - .../petstore/python-legacy/requirements.txt | 5 - .../client/petstore/python-legacy/setup.cfg | 2 - .../client/petstore/python-legacy/setup.py | 42 - .../python-legacy/test-requirements.txt | 4 - .../petstore/python-legacy/test/__init__.py | 0 .../test/test_additional_properties_class.py | 58 - .../test/test_all_of_with_single_ref.py | 52 - .../python-legacy/test/test_animal.py | 53 - .../test/test_another_fake_api.py | 40 - .../python-legacy/test/test_api_response.py | 53 - .../test_array_of_array_of_number_only.py | 55 - .../test/test_array_of_number_only.py | 53 - .../python-legacy/test/test_array_test.py | 65 - .../python-legacy/test/test_capitalization.py | 56 - .../petstore/python-legacy/test/test_cat.py | 37 - .../python-legacy/test/test_cat_all_of.py | 51 - .../python-legacy/test/test_category.py | 53 - .../python-legacy/test/test_class_model.py | 51 - .../python-legacy/test/test_client.py | 51 - .../python-legacy/test/test_configuration.py | 54 - .../python-legacy/test/test_default_api.py | 39 - .../test/test_deprecated_object.py | 51 - .../petstore/python-legacy/test/test_dog.py | 37 - .../python-legacy/test/test_dog_all_of.py | 51 - .../python-legacy/test/test_enum_arrays.py | 54 - .../python-legacy/test/test_enum_class.py | 50 - .../python-legacy/test/test_enum_test.py | 59 - .../python-legacy/test/test_fake_api.py | 146 - .../test/test_fake_classname_tags123_api.py | 40 - .../test/test_fake_classname_tags_123_api.py | 40 - .../petstore/python-legacy/test/test_file.py | 51 - .../test/test_file_schema_test_class.py | 56 - .../petstore/python-legacy/test/test_foo.py | 51 - .../test/test_foo_get_default_response.py | 52 - .../python-legacy/test/test_format_test.py | 70 - .../test/test_has_only_read_only.py | 52 - .../test/test_health_check_result.py | 51 - .../python-legacy/test/test_inline_object.py | 52 - .../python-legacy/test/test_inline_object1.py | 52 - .../python-legacy/test/test_inline_object2.py | 54 - .../python-legacy/test/test_inline_object3.py | 68 - .../python-legacy/test/test_inline_object4.py | 54 - .../python-legacy/test/test_inline_object5.py | 53 - .../test/test_inline_response_default.py | 52 - .../petstore/python-legacy/test/test_list.py | 51 - .../python-legacy/test/test_map_test.py | 64 - ...perties_and_additional_properties_class.py | 57 - .../test/test_model200_response.py | 52 - .../test/test_model_200_response.py | 52 - .../python-legacy/test/test_model_return.py | 51 - .../petstore/python-legacy/test/test_name.py | 55 - .../python-legacy/test/test_nullable_class.py | 74 - .../python-legacy/test/test_number_only.py | 51 - .../test_object_with_deprecated_fields.py | 57 - .../petstore/python-legacy/test/test_order.py | 56 - .../test/test_outer_composite.py | 53 - .../python-legacy/test/test_outer_enum.py | 50 - .../test/test_outer_enum_default_value.py | 50 - .../test/test_outer_enum_integer.py | 50 - .../test_outer_enum_integer_default_value.py | 50 - .../test_outer_object_with_enum_property.py | 52 - .../petstore/python-legacy/test/test_pet.py | 68 - .../python-legacy/test/test_pet_api.py | 96 - .../test/test_read_only_first.py | 52 - .../test/test_single_ref_type.py | 50 - .../test/test_special_model_name.py | 51 - .../python-legacy/test/test_store_api.py | 61 - .../petstore/python-legacy/test/test_tag.py | 52 - .../petstore/python-legacy/test/test_user.py | 58 - .../python-legacy/test/test_user_api.py | 89 - .../petstore/python-legacy/test_python2.sh | 33 - .../python-legacy/test_python2_and_3.sh | 31 - .../client/petstore/python-legacy/tox.ini | 9 - .../client/petstore/python-prior/.gitignore | 66 - .../petstore/python-prior/.gitlab-ci.yml | 24 - .../python-prior/.openapi-generator-ignore | 23 - .../python-prior/.openapi-generator/FILES | 236 - .../python-prior/.openapi-generator/VERSION | 1 - .../client/petstore/python-prior/.travis.yml | 13 - .../client/petstore/python-prior/Makefile | 16 - .../client/petstore/python-prior/README.md | 309 -- .../python-prior/dev-requirements.txt | 2 - .../docs/AdditionalPropertiesClass.md | 19 - .../AdditionalPropertiesWithArrayOfEnums.md | 11 - .../petstore/python-prior/docs/Address.md | 11 - .../petstore/python-prior/docs/Animal.md | 14 - .../petstore/python-prior/docs/AnimalFarm.md | 11 - .../python-prior/docs/AnotherFakeApi.md | 78 - .../petstore/python-prior/docs/ApiResponse.md | 14 - .../petstore/python-prior/docs/Apple.md | 13 - .../petstore/python-prior/docs/AppleReq.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 12 - .../python-prior/docs/ArrayOfEnums.md | 11 - .../python-prior/docs/ArrayOfNumberOnly.md | 12 - .../petstore/python-prior/docs/ArrayTest.md | 14 - .../petstore/python-prior/docs/Banana.md | 12 - .../petstore/python-prior/docs/BananaReq.md | 12 - .../petstore/python-prior/docs/BasquePig.md | 12 - .../petstore/python-prior/docs/BooleanEnum.md | 11 - .../python-prior/docs/Capitalization.md | 17 - .../client/petstore/python-prior/docs/Cat.md | 15 - .../petstore/python-prior/docs/CatAllOf.md | 12 - .../petstore/python-prior/docs/Category.md | 13 - .../petstore/python-prior/docs/ChildCat.md | 13 - .../python-prior/docs/ChildCatAllOf.md | 12 - .../petstore/python-prior/docs/ClassModel.md | 13 - .../petstore/python-prior/docs/Client.md | 12 - .../python-prior/docs/ComplexQuadrilateral.md | 13 - .../ComposedOneOfNumberWithValidations.md | 15 - .../ComposedSchemaWithPropsAndNoAddProps.md | 13 - .../petstore/python-prior/docs/DanishPig.md | 12 - .../petstore/python-prior/docs/DefaultApi.md | 69 - .../client/petstore/python-prior/docs/Dog.md | 16 - .../petstore/python-prior/docs/DogAllOf.md | 13 - .../petstore/python-prior/docs/Drawing.md | 15 - .../docs/EgressThresholdOptions.md | 12 - .../petstore/python-prior/docs/EnumArrays.md | 13 - .../petstore/python-prior/docs/EnumClass.md | 11 - .../petstore/python-prior/docs/EnumTest.md | 24 - .../python-prior/docs/EquilateralTriangle.md | 13 - .../petstore/python-prior/docs/FakeApi.md | 2141 --------- .../docs/FakeClassnameTags123Api.md | 89 - ...ineAdditionalPropertiesPayloadArrayData.md | 12 - .../client/petstore/python-prior/docs/File.md | 13 - .../python-prior/docs/FileSchemaTestClass.md | 13 - .../client/petstore/python-prior/docs/Foo.md | 12 - .../docs/FooGetDefaultResponse.md | 12 - .../petstore/python-prior/docs/FooObject.md | 13 - .../petstore/python-prior/docs/FormatTest.md | 27 - .../petstore/python-prior/docs/Fruit.md | 16 - .../petstore/python-prior/docs/FruitReq.md | 16 - .../petstore/python-prior/docs/GmFruit.md | 15 - .../python-prior/docs/GmFruitNoProperties.md | 14 - .../python-prior/docs/GrandparentAnimal.md | 12 - .../python-prior/docs/HasOnlyReadOnly.md | 13 - .../python-prior/docs/HealthCheckResult.md | 13 - .../InlineAdditionalPropertiesRefPayload.md | 13 - .../python-prior/docs/InlineObject.md | 11 - .../python-prior/docs/InlineObject1.md | 11 - .../python-prior/docs/InlineObject2.md | 11 - .../python-prior/docs/InlineObject3.md | 23 - .../python-prior/docs/InlineObject4.md | 11 - .../python-prior/docs/InlineObject5.md | 11 - .../python-prior/docs/InlineObject6.md | 13 - .../python-prior/docs/InlineResponse200.md | 13 - .../docs/InlineResponseDefault.md | 12 - .../petstore/python-prior/docs/IntegerEnum.md | 11 - .../python-prior/docs/IntegerEnumOneValue.md | 11 - .../docs/IntegerEnumWithDefaultValue.md | 11 - .../python-prior/docs/IsoscelesTriangle.md | 13 - .../client/petstore/python-prior/docs/Legs.md | 13 - .../client/petstore/python-prior/docs/List.md | 12 - .../petstore/python-prior/docs/Mammal.md | 15 - .../petstore/python-prior/docs/MapTest.md | 15 - ...dPropertiesAndAdditionalPropertiesClass.md | 14 - .../python-prior/docs/Model200Response.md | 14 - .../petstore/python-prior/docs/ModelReturn.md | 13 - .../python-prior/docs/Model_200Response.md | 14 - .../python-prior/docs/Model_Return.md | 13 - .../client/petstore/python-prior/docs/Mole.md | 17 - .../client/petstore/python-prior/docs/Name.md | 16 - .../python-prior/docs/NullableClass.md | 24 - .../python-prior/docs/NullableShape.md | 15 - .../petstore/python-prior/docs/NumberOnly.md | 12 - .../docs/NumberWithValidations.md | 11 - .../python-prior/docs/ObjectInterface.md | 11 - .../docs/ObjectModelWithRefProps.md | 16 - .../docs/ObjectWithValidations.md | 11 - .../petstore/python-prior/docs/Order.md | 17 - .../petstore/python-prior/docs/ParentPet.md | 12 - .../client/petstore/python-prior/docs/Pet.md | 18 - .../petstore/python-prior/docs/PetApi.md | 859 ---- .../client/petstore/python-prior/docs/Pig.md | 12 - ...nlineAdditionalPropertiesPayloadRequest.md | 13 - ...lPropertiesPayloadRequestArrayDataInner.md | 12 - .../python-prior/docs/PublishOptions.md | 12 - .../docs/PublishOptionsPublish.md | 13 - .../python-prior/docs/Quadrilateral.md | 13 - .../docs/QuadrilateralInterface.md | 12 - .../python-prior/docs/ReadOnlyFirst.md | 13 - .../petstore/python-prior/docs/Readonly.md | 12 - .../python-prior/docs/ScaleneTriangle.md | 13 - .../petstore/python-prior/docs/Shape.md | 14 - .../python-prior/docs/ShapeInterface.md | 12 - .../petstore/python-prior/docs/ShapeOrNull.md | 15 - .../python-prior/docs/SimpleQuadrilateral.md | 13 - .../petstore/python-prior/docs/SomeObject.md | 11 - .../docs/SomeObjectWithSelfAttr.md | 12 - .../python-prior/docs/SpecialModelName.md | 12 - .../petstore/python-prior/docs/StoreApi.md | 295 -- .../python-prior/docs/StreamOptions.md | 13 - .../python-prior/docs/StringBooleanMap.md | 11 - .../petstore/python-prior/docs/StringEnum.md | 13 - .../docs/StringEnumWithDefaultValue.md | 11 - .../client/petstore/python-prior/docs/Tag.md | 13 - .../petstore/python-prior/docs/Triangle.md | 13 - .../python-prior/docs/TriangleInterface.md | 12 - .../client/petstore/python-prior/docs/User.md | 23 - .../petstore/python-prior/docs/UserApi.md | 604 --- .../petstore/python-prior/docs/Whale.md | 14 - .../petstore/python-prior/docs/Zebra.md | 13 - .../client/petstore/python-prior/git_push.sh | 57 - .../python-prior/petstore_api/__init__.py | 30 - .../python-prior/petstore_api/api/__init__.py | 3 - .../petstore_api/api/another_fake_api.py | 171 - .../petstore_api/api/default_api.py | 157 - .../python-prior/petstore_api/api/fake_api.py | 4134 ----------------- .../api/fake_classname_tags123_api.py | 173 - .../api/fake_classname_tags_123_api.py | 173 - .../python-prior/petstore_api/api/pet_api.py | 1026 ---- .../petstore_api/api/store_api.py | 563 --- .../python-prior/petstore_api/api/user_api.py | 1096 ----- .../python-prior/petstore_api/api_client.py | 905 ---- .../petstore_api/apis/__init__.py | 23 - .../petstore_api/configuration.py | 617 --- .../python-prior/petstore_api/exceptions.py | 158 - .../petstore_api/model/__init__.py | 5 - .../model/additional_properties_class.py | 291 -- ...ditional_properties_with_array_of_enums.py | 265 -- .../petstore_api/model/address.py | 259 -- .../python-prior/petstore_api/model/animal.py | 292 -- .../petstore_api/model/animal_farm.py | 291 -- .../petstore_api/model/api_response.py | 271 -- .../python-prior/petstore_api/model/apple.py | 284 -- .../petstore_api/model/apple_req.py | 267 -- .../model/array_of_array_of_number_only.py | 263 -- .../petstore_api/model/array_of_enums.py | 291 -- .../model/array_of_number_only.py | 263 -- .../petstore_api/model/array_test.py | 277 -- .../python-prior/petstore_api/model/banana.py | 269 -- .../petstore_api/model/banana_req.py | 267 -- .../petstore_api/model/basque_pig.py | 269 -- .../petstore_api/model/boolean_enum.py | 281 -- .../petstore_api/model/capitalization.py | 283 -- .../python-prior/petstore_api/model/cat.py | 338 -- .../petstore_api/model/cat_all_of.py | 263 -- .../petstore_api/model/category.py | 275 -- .../petstore_api/model/child_cat.py | 329 -- .../petstore_api/model/child_cat_all_of.py | 263 -- .../petstore_api/model/class_model.py | 263 -- .../python-prior/petstore_api/model/client.py | 263 -- .../model/complex_quadrilateral.py | 326 -- ...composed_one_of_number_with_validations.py | 333 -- ...osed_schema_with_props_and_no_add_props.py | 320 -- .../petstore_api/model/danish_pig.py | 269 -- .../python-prior/petstore_api/model/dog.py | 344 -- .../petstore_api/model/dog_all_of.py | 273 -- .../petstore_api/model/drawing.py | 287 -- .../model/egress_threshold_options.py | 263 -- .../petstore_api/model/enum_arrays.py | 275 -- .../petstore_api/model/enum_class.py | 283 -- .../petstore_api/model/enum_test.py | 356 -- .../model/equilateral_triangle.py | 326 -- ...dditional_properties_payload_array_data.py | 263 -- .../python-prior/petstore_api/model/file.py | 263 -- .../model/file_schema_test_class.py | 273 -- .../python-prior/petstore_api/model/foo.py | 263 -- .../model/foo_get_default_response.py | 269 -- .../petstore_api/model/foo_object.py | 267 -- .../petstore_api/model/format_test.py | 378 -- .../python-prior/petstore_api/model/fruit.py | 345 -- .../petstore_api/model/fruit_req.py | 335 -- .../petstore_api/model/gm_fruit.py | 345 -- .../model/gm_fruit_no_properties.py | 341 -- .../petstore_api/model/grandparent_animal.py | 283 -- .../petstore_api/model/has_only_read_only.py | 269 -- .../petstore_api/model/health_check_result.py | 263 -- ...nline_additional_properties_ref_payload.py | 269 -- .../petstore_api/model/inline_object6.py | 269 -- .../model/inline_response_default.py | 269 -- .../petstore_api/model/integer_enum.py | 291 -- .../model/integer_enum_one_value.py | 281 -- .../model/integer_enum_with_default_value.py | 283 -- .../petstore_api/model/isosceles_triangle.py | 326 -- .../python-prior/petstore_api/model/legs.py | 279 -- .../python-prior/petstore_api/model/list.py | 263 -- .../python-prior/petstore_api/model/mammal.py | 349 -- .../petstore_api/model/map_test.py | 285 -- ...perties_and_additional_properties_class.py | 277 -- .../petstore_api/model/model200_response.py | 267 -- .../petstore_api/model/model_200_response.py | 267 -- .../petstore_api/model/model_return.py | 263 -- .../python-prior/petstore_api/model/mole.py | 292 -- .../python-prior/petstore_api/model/name.py | 283 -- .../petstore_api/model/nullable_class.py | 311 -- .../petstore_api/model/nullable_shape.py | 336 -- .../petstore_api/model/number_only.py | 263 -- .../model/number_with_validations.py | 290 -- .../petstore_api/model/object_interface.py | 259 -- .../model/object_model_with_ref_props.py | 283 -- .../model/object_with_validations.py | 262 -- .../python-prior/petstore_api/model/order.py | 288 -- .../petstore_api/model/parent_pet.py | 326 -- .../python-prior/petstore_api/model/pet.py | 304 -- .../python-prior/petstore_api/model/pig.py | 328 -- ...e_additional_properties_payload_request.py | 269 -- ...erties_payload_request_array_data_inner.py | 263 -- .../petstore_api/model/publish_options.py | 269 -- .../model/publish_options_publish.py | 267 -- .../petstore_api/model/quadrilateral.py | 332 -- .../model/quadrilateral_interface.py | 269 -- .../petstore_api/model/read_only_first.py | 268 -- .../petstore_api/model/readonly.py | 263 -- .../petstore_api/model/scalene_triangle.py | 326 -- .../python-prior/petstore_api/model/shape.py | 336 -- .../petstore_api/model/shape_interface.py | 269 -- .../petstore_api/model/shape_or_null.py | 337 -- .../model/simple_quadrilateral.py | 326 -- .../petstore_api/model/some_object.py | 315 -- .../model/some_object_with_self_attr.py | 263 -- .../petstore_api/model/special_model_name.py | 263 -- .../petstore_api/model/stream_options.py | 328 -- .../petstore_api/model/string_boolean_map.py | 259 -- .../petstore_api/model/string_enum.py | 305 -- .../model/string_enum_with_default_value.py | 283 -- .../python-prior/petstore_api/model/tag.py | 267 -- .../petstore_api/model/triangle.py | 336 -- .../petstore_api/model/triangle_interface.py | 269 -- .../python-prior/petstore_api/model/user.py | 307 -- .../python-prior/petstore_api/model/whale.py | 277 -- .../python-prior/petstore_api/model/zebra.py | 278 -- .../python-prior/petstore_api/model_utils.py | 2058 -------- .../petstore_api/models/__init__.py | 111 - .../python-prior/petstore_api/rest.py | 356 -- .../python-prior/petstore_api/signing.py | 416 -- .../client/petstore/python-prior/pom.xml | 46 - .../petstore/python-prior/requirements.txt | 3 - .../client/petstore/python-prior/setup.cfg | 2 - .../client/petstore/python-prior/setup.py | 45 - .../python-prior/test-requirements.txt | 2 - .../petstore/python-prior/test/__init__.py | 0 .../test/test_additional_properties_class.py | 37 - ...ditional_properties_with_array_of_enums.py | 39 - .../python-prior/test/test_address.py | 37 - .../petstore/python-prior/test/test_animal.py | 41 - .../python-prior/test/test_animal_farm.py | 39 - .../test/test_another_fake_api.py | 37 - .../python-prior/test/test_api_response.py | 37 - .../petstore/python-prior/test/test_apple.py | 37 - .../python-prior/test/test_apple_req.py | 37 - .../test_array_of_array_of_number_only.py | 37 - .../python-prior/test/test_array_of_enums.py | 39 - .../test/test_array_of_number_only.py | 37 - .../python-prior/test/test_array_test.py | 39 - .../petstore/python-prior/test/test_banana.py | 37 - .../python-prior/test/test_banana_req.py | 37 - .../python-prior/test/test_basque_pig.py | 37 - .../python-prior/test/test_boolean_enum.py | 35 - .../python-prior/test/test_capitalization.py | 37 - .../petstore/python-prior/test/test_cat.py | 43 - .../python-prior/test/test_cat_all_of.py | 37 - .../python-prior/test/test_category.py | 37 - .../python-prior/test/test_child_cat.py | 41 - .../test/test_child_cat_all_of.py | 37 - .../python-prior/test/test_class_model.py | 37 - .../petstore/python-prior/test/test_client.py | 37 - .../test/test_complex_quadrilateral.py | 41 - ...composed_one_of_number_with_validations.py | 41 - ...osed_schema_with_props_and_no_add_props.py | 37 - .../python-prior/test/test_danish_pig.py | 37 - .../python-prior/test/test_default_api.py | 36 - .../petstore/python-prior/test/test_dog.py | 41 - .../python-prior/test/test_dog_all_of.py | 37 - .../python-prior/test/test_drawing.py | 45 - .../test/test_egress_threshold_options.py | 35 - .../python-prior/test/test_enum_arrays.py | 37 - .../python-prior/test/test_enum_class.py | 37 - .../python-prior/test/test_enum_test.py | 47 - .../test/test_equilateral_triangle.py | 41 - .../python-prior/test/test_fake_api.py | 210 - .../test/test_fake_classname_tags123_api.py | 35 - .../test/test_fake_classname_tags_123_api.py | 37 - ...dditional_properties_payload_array_data.py | 35 - .../petstore/python-prior/test/test_file.py | 37 - .../test/test_file_schema_test_class.py | 39 - .../petstore/python-prior/test/test_foo.py | 37 - .../test/test_foo_get_default_response.py | 37 - .../python-prior/test/test_foo_object.py | 35 - .../python-prior/test/test_format_test.py | 37 - .../petstore/python-prior/test/test_fruit.py | 41 - .../python-prior/test/test_fruit_req.py | 41 - .../python-prior/test/test_gm_fruit.py | 41 - .../test/test_gm_fruit_no_properties.py | 39 - .../test/test_grandparent_animal.py | 41 - .../test/test_has_only_read_only.py | 37 - .../test/test_health_check_result.py | 37 - ...nline_additional_properties_ref_payload.py | 37 - .../python-prior/test/test_inline_object6.py | 37 - .../test/test_inline_response_default.py | 39 - .../python-prior/test/test_integer_enum.py | 37 - .../test/test_integer_enum_one_value.py | 37 - .../test_integer_enum_with_default_value.py | 37 - .../test/test_isosceles_triangle.py | 41 - .../petstore/python-prior/test/test_legs.py | 35 - .../petstore/python-prior/test/test_list.py | 37 - .../petstore/python-prior/test/test_mammal.py | 43 - .../python-prior/test/test_map_test.py | 39 - ...perties_and_additional_properties_class.py | 39 - .../test/test_model200_response.py | 37 - .../test/test_model_200_response.py | 35 - .../python-prior/test/test_model_return.py | 37 - .../petstore/python-prior/test/test_mole.py | 35 - .../petstore/python-prior/test/test_name.py | 37 - .../python-prior/test/test_nullable_class.py | 37 - .../python-prior/test/test_nullable_shape.py | 41 - .../python-prior/test/test_number_only.py | 37 - .../test/test_number_with_validations.py | 37 - .../test/test_object_interface.py | 37 - .../test/test_object_model_with_ref_props.py | 39 - .../test/test_object_with_validations.py | 37 - .../petstore/python-prior/test/test_order.py | 37 - .../python-prior/test/test_parent_pet.py | 41 - .../petstore/python-prior/test/test_pet.py | 41 - .../python-prior/test/test_pet_api.py | 93 - .../petstore/python-prior/test/test_pig.py | 41 - ...e_additional_properties_payload_request.py | 37 - ...erties_payload_request_array_data_inner.py | 35 - .../python-prior/test/test_publish_options.py | 37 - .../test/test_publish_options_publish.py | 35 - .../python-prior/test/test_quadrilateral.py | 41 - .../test/test_quadrilateral_interface.py | 37 - .../python-prior/test/test_read_only_first.py | 37 - .../python-prior/test/test_readonly.py | 35 - .../test/test_scalene_triangle.py | 41 - .../petstore/python-prior/test/test_shape.py | 41 - .../python-prior/test/test_shape_interface.py | 37 - .../python-prior/test/test_shape_or_null.py | 41 - .../test/test_simple_quadrilateral.py | 41 - .../python-prior/test/test_some_object.py | 39 - .../test/test_some_object_with_self_attr.py | 35 - .../test/test_special_model_name.py | 37 - .../python-prior/test/test_store_api.py | 58 - .../python-prior/test/test_stream_options.py | 41 - .../test/test_string_boolean_map.py | 37 - .../python-prior/test/test_string_enum.py | 37 - .../test_string_enum_with_default_value.py | 37 - .../petstore/python-prior/test/test_tag.py | 37 - .../python-prior/test/test_triangle.py | 43 - .../test/test_triangle_interface.py | 37 - .../petstore/python-prior/test/test_user.py | 37 - .../python-prior/test/test_user_api.py | 86 - .../petstore/python-prior/test/test_whale.py | 37 - .../petstore/python-prior/test/test_zebra.py | 37 - .../petstore/python-prior/test_python.sh | 31 - .../python-prior/testfiles/1px_pic1.png | Bin 67 -> 0 bytes .../python-prior/testfiles/1px_pic2.png | Bin 67 -> 0 bytes .../python-prior/tests_manual/__init__.py | 0 .../tests_manual/test_api_validation.py | 175 - .../tests_manual/test_boolean_enum.py | 39 - ...composed_one_of_number_with_validations.py | 46 - ...osed_schema_with_props_and_no_add_props.py | 45 - .../python-prior/tests_manual/test_copy.py | 42 - .../tests_manual/test_deserialization.py | 326 -- .../test_discard_unknown_properties.py | 173 - .../python-prior/tests_manual/test_drawing.py | 170 - .../tests_manual/test_enum_test.py | 59 - .../test_extra_pool_config_options.py | 61 - .../tests_manual/test_fake_api.py | 823 ---- .../python-prior/tests_manual/test_fruit.py | 247 - .../tests_manual/test_fruit_req.py | 175 - .../tests_manual/test_gm_fruit.py | 217 - .../tests_manual/test_http_signature.py | 516 -- .../test_integer_enum_one_value.py | 42 - .../tests_manual/test_issue10083.py | 41 - .../tests_manual/test_issue10155.py | 52 - .../python-prior/tests_manual/test_mammal.py | 49 - .../python-prior/tests_manual/test_mole.py | 78 - .../test_number_with_validations.py | 43 - .../test_object_model_with_ref_props.py | 50 - .../tests_manual/test_parent_pet.py | 50 - .../tests_manual/test_quadrilateral.py | 48 - .../python-prior/tests_manual/test_shape.py | 115 - .../tests_manual/test_string_enum.py | 53 - .../python-prior/tests_manual/test_tag.py | 35 - .../tests_manual/test_triangle.py | 55 - .../python-prior/tests_manual/util.py | 8 - .../client/petstore/python-prior/tox.ini | 9 - 1911 files changed, 1 insertion(+), 255885 deletions(-) delete mode 100644 bin/configs/python-asyncio.yaml delete mode 100644 bin/configs/python-legacy-oas2.yaml delete mode 100644 bin/configs/python-legacy.yaml delete mode 100644 bin/configs/python-prior-extensions-x-auth-id-alias.yaml delete mode 100644 bin/configs/python-prior-oas2.yaml delete mode 100644 bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml delete mode 100644 bin/configs/python-prior.yaml delete mode 100644 bin/configs/python-tornado.yaml delete mode 100644 docs/generators/python-legacy.md delete mode 100644 docs/generators/python-prior.md delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/__init__.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache delete mode 100755 modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/setup.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/tox.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-legacy/travis.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/README_common.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/api_client.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/api_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/configuration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache delete mode 100755 modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/requirements.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/setup.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/signing.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/tox.mustache delete mode 100644 modules/openapi-generator/src/main/resources/python-prior/travis.mustache delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java delete mode 100644 samples/client/petstore/python-asyncio/.gitignore delete mode 100644 samples/client/petstore/python-asyncio/.gitlab-ci.yml delete mode 100644 samples/client/petstore/python-asyncio/.openapi-generator-ignore delete mode 100644 samples/client/petstore/python-asyncio/.openapi-generator/FILES delete mode 100644 samples/client/petstore/python-asyncio/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/python-asyncio/.travis.yml delete mode 100644 samples/client/petstore/python-asyncio/Makefile delete mode 100644 samples/client/petstore/python-asyncio/README.md delete mode 100644 samples/client/petstore/python-asyncio/dev-requirements.txt delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Animal.md delete mode 100644 samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ApiResponse.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ArrayTest.md delete mode 100644 samples/client/petstore/python-asyncio/docs/BigCat.md delete mode 100644 samples/client/petstore/python-asyncio/docs/BigCatAllOf.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Capitalization.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Cat.md delete mode 100644 samples/client/petstore/python-asyncio/docs/CatAllOf.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Category.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ClassModel.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Client.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Dog.md delete mode 100644 samples/client/petstore/python-asyncio/docs/DogAllOf.md delete mode 100644 samples/client/petstore/python-asyncio/docs/EnumArrays.md delete mode 100644 samples/client/petstore/python-asyncio/docs/EnumClass.md delete mode 100644 samples/client/petstore/python-asyncio/docs/EnumTest.md delete mode 100644 samples/client/petstore/python-asyncio/docs/FakeApi.md delete mode 100644 samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/python-asyncio/docs/File.md delete mode 100644 samples/client/petstore/python-asyncio/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/python-asyncio/docs/FormatTest.md delete mode 100644 samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/python-asyncio/docs/List.md delete mode 100644 samples/client/petstore/python-asyncio/docs/MapTest.md delete mode 100644 samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Model200Response.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ModelReturn.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Model_200Response.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Model_Return.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Name.md delete mode 100644 samples/client/petstore/python-asyncio/docs/NumberOnly.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Order.md delete mode 100644 samples/client/petstore/python-asyncio/docs/OuterComposite.md delete mode 100644 samples/client/petstore/python-asyncio/docs/OuterEnum.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Pet.md delete mode 100644 samples/client/petstore/python-asyncio/docs/PetApi.md delete mode 100644 samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/python-asyncio/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/python-asyncio/docs/StoreApi.md delete mode 100644 samples/client/petstore/python-asyncio/docs/Tag.md delete mode 100644 samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/python-asyncio/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/python-asyncio/docs/User.md delete mode 100644 samples/client/petstore/python-asyncio/docs/UserApi.md delete mode 100644 samples/client/petstore/python-asyncio/docs/XmlItem.md delete mode 100644 samples/client/petstore/python-asyncio/git_push.sh delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/__init__.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/__init__.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/store_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/user_api.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/api_client.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/configuration.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/exceptions.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/__init__.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_array.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_integer.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_number.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_object.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_string.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/animal.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/api_response.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_test.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/big_cat.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/big_cat_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/cat.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/cat_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/category.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/class_model.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/client.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/dog.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/dog_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/file.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/file_schema_test_class.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/format_test.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/list.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/map_test.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/model_return.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/name.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/number_only.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/order.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/pet.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/tag.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/user.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/xml_item.py delete mode 100644 samples/client/petstore/python-asyncio/petstore_api/rest.py delete mode 100644 samples/client/petstore/python-asyncio/pom.xml delete mode 100644 samples/client/petstore/python-asyncio/requirements.txt delete mode 100644 samples/client/petstore/python-asyncio/setup.cfg delete mode 100644 samples/client/petstore/python-asyncio/setup.py delete mode 100644 samples/client/petstore/python-asyncio/test-requirements.txt delete mode 100644 samples/client/petstore/python-asyncio/test/__init__.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_array.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_class.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_integer.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_number.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_object.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_string.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_animal.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_another_fake_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_api_response.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_array_of_number_only.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_array_test.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_big_cat.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_big_cat_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_capitalization.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_cat.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_cat_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_category.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_class_model.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_client.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_dog.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_dog_all_of.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_enum_class.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_enum_test.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_fake_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_file.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_file_schema_test_class.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_format_test.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_has_only_read_only.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_list.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_map_test.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_model200_response.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_model_200_response.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_model_return.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_name.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_number_only.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_order.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_outer_composite.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_outer_enum.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_pet.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_pet_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_read_only_first.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_special_model_name.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_store_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_tag.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_type_holder_default.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_type_holder_example.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_user.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_user_api.py delete mode 100644 samples/client/petstore/python-asyncio/test/test_xml_item.py delete mode 100755 samples/client/petstore/python-asyncio/test_python3.sh delete mode 100644 samples/client/petstore/python-asyncio/testfiles/foo.png delete mode 100644 samples/client/petstore/python-asyncio/tests/__init__.py delete mode 100644 samples/client/petstore/python-asyncio/tests/test_api_client.py delete mode 100644 samples/client/petstore/python-asyncio/tests/test_pet_api.py delete mode 100644 samples/client/petstore/python-asyncio/tests/util.py delete mode 100644 samples/client/petstore/python-asyncio/tox.ini delete mode 100644 samples/client/petstore/python-legacy/.gitignore delete mode 100644 samples/client/petstore/python-legacy/.gitlab-ci.yml delete mode 100644 samples/client/petstore/python-legacy/.openapi-generator-ignore delete mode 100644 samples/client/petstore/python-legacy/.openapi-generator/FILES delete mode 100644 samples/client/petstore/python-legacy/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/python-legacy/.travis.yml delete mode 100644 samples/client/petstore/python-legacy/Makefile delete mode 100644 samples/client/petstore/python-legacy/README.md delete mode 100644 samples/client/petstore/python-legacy/dev-requirements.txt delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/python-legacy/docs/Animal.md delete mode 100644 samples/client/petstore/python-legacy/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/python-legacy/docs/ApiResponse.md delete mode 100644 samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-legacy/docs/ArrayTest.md delete mode 100644 samples/client/petstore/python-legacy/docs/BigCat.md delete mode 100644 samples/client/petstore/python-legacy/docs/BigCatAllOf.md delete mode 100644 samples/client/petstore/python-legacy/docs/Capitalization.md delete mode 100644 samples/client/petstore/python-legacy/docs/Cat.md delete mode 100644 samples/client/petstore/python-legacy/docs/CatAllOf.md delete mode 100644 samples/client/petstore/python-legacy/docs/Category.md delete mode 100644 samples/client/petstore/python-legacy/docs/ClassModel.md delete mode 100644 samples/client/petstore/python-legacy/docs/Client.md delete mode 100644 samples/client/petstore/python-legacy/docs/Dog.md delete mode 100644 samples/client/petstore/python-legacy/docs/DogAllOf.md delete mode 100644 samples/client/petstore/python-legacy/docs/EnumArrays.md delete mode 100644 samples/client/petstore/python-legacy/docs/EnumClass.md delete mode 100644 samples/client/petstore/python-legacy/docs/EnumTest.md delete mode 100644 samples/client/petstore/python-legacy/docs/FakeApi.md delete mode 100644 samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/python-legacy/docs/File.md delete mode 100644 samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/python-legacy/docs/FormatTest.md delete mode 100644 samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/python-legacy/docs/List.md delete mode 100644 samples/client/petstore/python-legacy/docs/MapTest.md delete mode 100644 samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-legacy/docs/Model200Response.md delete mode 100644 samples/client/petstore/python-legacy/docs/ModelReturn.md delete mode 100644 samples/client/petstore/python-legacy/docs/Model_200Response.md delete mode 100644 samples/client/petstore/python-legacy/docs/Model_Return.md delete mode 100644 samples/client/petstore/python-legacy/docs/Name.md delete mode 100644 samples/client/petstore/python-legacy/docs/NumberOnly.md delete mode 100644 samples/client/petstore/python-legacy/docs/Order.md delete mode 100644 samples/client/petstore/python-legacy/docs/OuterComposite.md delete mode 100644 samples/client/petstore/python-legacy/docs/OuterEnum.md delete mode 100644 samples/client/petstore/python-legacy/docs/Pet.md delete mode 100644 samples/client/petstore/python-legacy/docs/PetApi.md delete mode 100644 samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/python-legacy/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/python-legacy/docs/StoreApi.md delete mode 100644 samples/client/petstore/python-legacy/docs/Tag.md delete mode 100644 samples/client/petstore/python-legacy/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/python-legacy/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/python-legacy/docs/User.md delete mode 100644 samples/client/petstore/python-legacy/docs/UserApi.md delete mode 100644 samples/client/petstore/python-legacy/docs/XmlItem.md delete mode 100644 samples/client/petstore/python-legacy/git_push.sh delete mode 100644 samples/client/petstore/python-legacy/petstore_api/__init__.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/__init__.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/fake_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/pet_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/store_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api/user_api.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/api_client.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/configuration.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/exceptions.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/__init__.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/animal.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/api_response.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/array_test.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/big_cat.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/capitalization.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/cat.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/category.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/class_model.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/client.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/dog.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/enum_class.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/enum_test.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/file.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/format_test.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/list.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/map_test.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/model200_response.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/model_200_response.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/model_return.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/name.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/number_only.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/order.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/pet.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/tag.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/user.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/models/xml_item.py delete mode 100644 samples/client/petstore/python-legacy/petstore_api/rest.py delete mode 100644 samples/client/petstore/python-legacy/pom.xml delete mode 100644 samples/client/petstore/python-legacy/requirements.txt delete mode 100644 samples/client/petstore/python-legacy/setup.cfg delete mode 100644 samples/client/petstore/python-legacy/setup.py delete mode 100644 samples/client/petstore/python-legacy/test-requirements.txt delete mode 100644 samples/client/petstore/python-legacy/test/__init__.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_array.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_class.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_integer.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_number.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_object.py delete mode 100644 samples/client/petstore/python-legacy/test/test_additional_properties_string.py delete mode 100644 samples/client/petstore/python-legacy/test/test_animal.py delete mode 100644 samples/client/petstore/python-legacy/test/test_another_fake_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_api_response.py delete mode 100644 samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-legacy/test/test_array_of_number_only.py delete mode 100644 samples/client/petstore/python-legacy/test/test_array_test.py delete mode 100644 samples/client/petstore/python-legacy/test/test_big_cat.py delete mode 100644 samples/client/petstore/python-legacy/test/test_big_cat_all_of.py delete mode 100644 samples/client/petstore/python-legacy/test/test_capitalization.py delete mode 100644 samples/client/petstore/python-legacy/test/test_cat.py delete mode 100644 samples/client/petstore/python-legacy/test/test_cat_all_of.py delete mode 100644 samples/client/petstore/python-legacy/test/test_category.py delete mode 100644 samples/client/petstore/python-legacy/test/test_class_model.py delete mode 100644 samples/client/petstore/python-legacy/test/test_client.py delete mode 100644 samples/client/petstore/python-legacy/test/test_dog.py delete mode 100644 samples/client/petstore/python-legacy/test/test_dog_all_of.py delete mode 100644 samples/client/petstore/python-legacy/test/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-legacy/test/test_enum_class.py delete mode 100644 samples/client/petstore/python-legacy/test/test_enum_test.py delete mode 100644 samples/client/petstore/python-legacy/test/test_fake_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_file.py delete mode 100644 samples/client/petstore/python-legacy/test/test_file_schema_test_class.py delete mode 100644 samples/client/petstore/python-legacy/test/test_format_test.py delete mode 100644 samples/client/petstore/python-legacy/test/test_has_only_read_only.py delete mode 100644 samples/client/petstore/python-legacy/test/test_list.py delete mode 100644 samples/client/petstore/python-legacy/test/test_map_test.py delete mode 100644 samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-legacy/test/test_model200_response.py delete mode 100644 samples/client/petstore/python-legacy/test/test_model_200_response.py delete mode 100644 samples/client/petstore/python-legacy/test/test_model_return.py delete mode 100644 samples/client/petstore/python-legacy/test/test_name.py delete mode 100644 samples/client/petstore/python-legacy/test/test_number_only.py delete mode 100644 samples/client/petstore/python-legacy/test/test_order.py delete mode 100644 samples/client/petstore/python-legacy/test/test_outer_composite.py delete mode 100644 samples/client/petstore/python-legacy/test/test_outer_enum.py delete mode 100644 samples/client/petstore/python-legacy/test/test_pet.py delete mode 100644 samples/client/petstore/python-legacy/test/test_pet_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_read_only_first.py delete mode 100644 samples/client/petstore/python-legacy/test/test_special_model_name.py delete mode 100644 samples/client/petstore/python-legacy/test/test_store_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_tag.py delete mode 100644 samples/client/petstore/python-legacy/test/test_type_holder_default.py delete mode 100644 samples/client/petstore/python-legacy/test/test_type_holder_example.py delete mode 100644 samples/client/petstore/python-legacy/test/test_user.py delete mode 100644 samples/client/petstore/python-legacy/test/test_user_api.py delete mode 100644 samples/client/petstore/python-legacy/test/test_xml_item.py delete mode 100755 samples/client/petstore/python-legacy/test_python2.sh delete mode 100755 samples/client/petstore/python-legacy/test_python2_and_3.sh delete mode 100644 samples/client/petstore/python-legacy/testfiles/foo.png delete mode 100644 samples/client/petstore/python-legacy/tests/__init__.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_api_client.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_api_exception.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_configuration.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_deserialization.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_map_test.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_order_model.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_pet_api.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_pet_model.py delete mode 100644 samples/client/petstore/python-legacy/tests/test_store_api.py delete mode 100644 samples/client/petstore/python-legacy/tests/util.py delete mode 100644 samples/client/petstore/python-legacy/tox.ini delete mode 100644 samples/client/petstore/python-prior/.gitignore delete mode 100644 samples/client/petstore/python-prior/.gitlab-ci.yml delete mode 100644 samples/client/petstore/python-prior/.openapi-generator-ignore delete mode 100644 samples/client/petstore/python-prior/.openapi-generator/FILES delete mode 100644 samples/client/petstore/python-prior/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/python-prior/.travis.yml delete mode 100644 samples/client/petstore/python-prior/Makefile delete mode 100644 samples/client/petstore/python-prior/README.md delete mode 100644 samples/client/petstore/python-prior/dev-requirements.txt delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/python-prior/docs/Animal.md delete mode 100644 samples/client/petstore/python-prior/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/python-prior/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/python-prior/docs/ApiResponse.md delete mode 100644 samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-prior/docs/ArrayTest.md delete mode 100644 samples/client/petstore/python-prior/docs/Capitalization.md delete mode 100644 samples/client/petstore/python-prior/docs/Cat.md delete mode 100644 samples/client/petstore/python-prior/docs/CatAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/Category.md delete mode 100644 samples/client/petstore/python-prior/docs/Child.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildCat.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildCatAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildDog.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildDogAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildLizard.md delete mode 100644 samples/client/petstore/python-prior/docs/ChildLizardAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ClassModel.md delete mode 100644 samples/client/petstore/python-prior/docs/Client.md delete mode 100644 samples/client/petstore/python-prior/docs/Dog.md delete mode 100644 samples/client/petstore/python-prior/docs/DogAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/EnumArrays.md delete mode 100644 samples/client/petstore/python-prior/docs/EnumClass.md delete mode 100644 samples/client/petstore/python-prior/docs/EnumTest.md delete mode 100644 samples/client/petstore/python-prior/docs/FakeApi.md delete mode 100644 samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/python-prior/docs/File.md delete mode 100644 samples/client/petstore/python-prior/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/python-prior/docs/FormatTest.md delete mode 100644 samples/client/petstore/python-prior/docs/Grandparent.md delete mode 100644 samples/client/petstore/python-prior/docs/GrandparentAnimal.md delete mode 100644 samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/python-prior/docs/List.md delete mode 100644 samples/client/petstore/python-prior/docs/MapTest.md delete mode 100644 samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-prior/docs/Model200Response.md delete mode 100644 samples/client/petstore/python-prior/docs/ModelReturn.md delete mode 100644 samples/client/petstore/python-prior/docs/Model_200Response.md delete mode 100644 samples/client/petstore/python-prior/docs/Model_Return.md delete mode 100644 samples/client/petstore/python-prior/docs/Name.md delete mode 100644 samples/client/petstore/python-prior/docs/NumberOnly.md delete mode 100644 samples/client/petstore/python-prior/docs/NumberWithValidations.md delete mode 100644 samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md delete mode 100644 samples/client/petstore/python-prior/docs/Order.md delete mode 100644 samples/client/petstore/python-prior/docs/Parent.md delete mode 100644 samples/client/petstore/python-prior/docs/ParentAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ParentPet.md delete mode 100644 samples/client/petstore/python-prior/docs/Pet.md delete mode 100644 samples/client/petstore/python-prior/docs/PetApi.md delete mode 100644 samples/client/petstore/python-prior/docs/Player.md delete mode 100644 samples/client/petstore/python-prior/docs/Polygon.md delete mode 100644 samples/client/petstore/python-prior/docs/PolygonAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/python-prior/docs/Shape.md delete mode 100644 samples/client/petstore/python-prior/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/python-prior/docs/Square.md delete mode 100644 samples/client/petstore/python-prior/docs/SquareAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/StoreApi.md delete mode 100644 samples/client/petstore/python-prior/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/python-prior/docs/StringEnum.md delete mode 100644 samples/client/petstore/python-prior/docs/Tag.md delete mode 100644 samples/client/petstore/python-prior/docs/Triangle.md delete mode 100644 samples/client/petstore/python-prior/docs/TriangleAllOf.md delete mode 100644 samples/client/petstore/python-prior/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/python-prior/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/python-prior/docs/User.md delete mode 100644 samples/client/petstore/python-prior/docs/UserApi.md delete mode 100644 samples/client/petstore/python-prior/docs/XmlItem.md delete mode 100644 samples/client/petstore/python-prior/git_push.sh delete mode 100644 samples/client/petstore/python-prior/petstore_api/__init__.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/__init__.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/fake_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/pet_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/store_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api/user_api.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/api_client.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/apis/__init__.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/configuration.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/exceptions.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/__init__.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/animal.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/animal_farm.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/api_response.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/array_test.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/capitalization.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/cat.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/category.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_cat.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_dog.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_lizard.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/class_model.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/client.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/dog.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/enum_class.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/enum_test.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/file.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/format_test.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/grandparent.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/list.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/map_test.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/model200_response.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/model_200_response.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/model_return.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/name.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/number_only.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/order.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/parent.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/parent_pet.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/pet.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/player.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/polygon.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/read_only_first.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/shape.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/special_model_name.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/square.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/square_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/string_enum.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/tag.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/triangle.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/user.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model/xml_item.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/model_utils.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/models/__init__.py delete mode 100644 samples/client/petstore/python-prior/petstore_api/rest.py delete mode 100644 samples/client/petstore/python-prior/pom.xml delete mode 100644 samples/client/petstore/python-prior/requirements.txt delete mode 100644 samples/client/petstore/python-prior/setup.cfg delete mode 100644 samples/client/petstore/python-prior/setup.py delete mode 100644 samples/client/petstore/python-prior/test-requirements.txt delete mode 100644 samples/client/petstore/python-prior/test/__init__.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_array.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_integer.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_number.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_object.py delete mode 100644 samples/client/petstore/python-prior/test/test_additional_properties_string.py delete mode 100644 samples/client/petstore/python-prior/test/test_animal.py delete mode 100644 samples/client/petstore/python-prior/test/test_animal_farm.py delete mode 100644 samples/client/petstore/python-prior/test/test_another_fake_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_api_response.py delete mode 100644 samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior/test/test_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior/test/test_array_test.py delete mode 100644 samples/client/petstore/python-prior/test/test_capitalization.py delete mode 100644 samples/client/petstore/python-prior/test/test_cat.py delete mode 100644 samples/client/petstore/python-prior/test/test_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_category.py delete mode 100644 samples/client/petstore/python-prior/test/test_child.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_cat.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_dog.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_lizard.py delete mode 100644 samples/client/petstore/python-prior/test/test_child_lizard_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_class_model.py delete mode 100644 samples/client/petstore/python-prior/test/test_client.py delete mode 100644 samples/client/petstore/python-prior/test/test_dog.py delete mode 100644 samples/client/petstore/python-prior/test/test_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-prior/test/test_enum_class.py delete mode 100644 samples/client/petstore/python-prior/test/test_enum_test.py delete mode 100644 samples/client/petstore/python-prior/test/test_fake_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_file.py delete mode 100644 samples/client/petstore/python-prior/test/test_file_schema_test_class.py delete mode 100644 samples/client/petstore/python-prior/test/test_format_test.py delete mode 100644 samples/client/petstore/python-prior/test/test_grandparent.py delete mode 100644 samples/client/petstore/python-prior/test/test_grandparent_animal.py delete mode 100644 samples/client/petstore/python-prior/test/test_has_only_read_only.py delete mode 100644 samples/client/petstore/python-prior/test/test_list.py delete mode 100644 samples/client/petstore/python-prior/test/test_map_test.py delete mode 100644 samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior/test/test_model200_response.py delete mode 100644 samples/client/petstore/python-prior/test/test_model_200_response.py delete mode 100644 samples/client/petstore/python-prior/test/test_model_return.py delete mode 100644 samples/client/petstore/python-prior/test/test_name.py delete mode 100644 samples/client/petstore/python-prior/test/test_number_only.py delete mode 100644 samples/client/petstore/python-prior/test/test_number_with_validations.py delete mode 100644 samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py delete mode 100644 samples/client/petstore/python-prior/test/test_order.py delete mode 100644 samples/client/petstore/python-prior/test/test_parent.py delete mode 100644 samples/client/petstore/python-prior/test/test_parent_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_parent_pet.py delete mode 100644 samples/client/petstore/python-prior/test/test_pet.py delete mode 100644 samples/client/petstore/python-prior/test/test_pet_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_player.py delete mode 100644 samples/client/petstore/python-prior/test/test_polygon.py delete mode 100644 samples/client/petstore/python-prior/test/test_polygon_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_read_only_first.py delete mode 100644 samples/client/petstore/python-prior/test/test_shape.py delete mode 100644 samples/client/petstore/python-prior/test/test_special_model_name.py delete mode 100644 samples/client/petstore/python-prior/test/test_square.py delete mode 100644 samples/client/petstore/python-prior/test/test_square_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_store_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_string_boolean_map.py delete mode 100644 samples/client/petstore/python-prior/test/test_string_enum.py delete mode 100644 samples/client/petstore/python-prior/test/test_tag.py delete mode 100644 samples/client/petstore/python-prior/test/test_triangle.py delete mode 100644 samples/client/petstore/python-prior/test/test_triangle_all_of.py delete mode 100644 samples/client/petstore/python-prior/test/test_type_holder_default.py delete mode 100644 samples/client/petstore/python-prior/test/test_type_holder_example.py delete mode 100644 samples/client/petstore/python-prior/test/test_user.py delete mode 100644 samples/client/petstore/python-prior/test/test_user_api.py delete mode 100644 samples/client/petstore/python-prior/test/test_xml_item.py delete mode 100644 samples/client/petstore/python-prior/test_python.sh delete mode 100644 samples/client/petstore/python-prior/testfiles/1px_pic1.png delete mode 100644 samples/client/petstore/python-prior/testfiles/1px_pic2.png delete mode 100644 samples/client/petstore/python-prior/testfiles/foo.png delete mode 100644 samples/client/petstore/python-prior/tests/__init__.py delete mode 100644 samples/client/petstore/python-prior/tests/test_api_client.py delete mode 100644 samples/client/petstore/python-prior/tests/test_api_exception.py delete mode 100644 samples/client/petstore/python-prior/tests/test_deserialization.py delete mode 100644 samples/client/petstore/python-prior/tests/test_pet_api.py delete mode 100644 samples/client/petstore/python-prior/tests/test_serialization.py delete mode 100644 samples/client/petstore/python-prior/tests/test_store_api.py delete mode 100644 samples/client/petstore/python-prior/tests/util.py delete mode 100644 samples/client/petstore/python-prior/tox.ini delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py delete mode 100644 samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini delete mode 100644 samples/client/petstore/python-tornado/.gitignore delete mode 100644 samples/client/petstore/python-tornado/.gitlab-ci.yml delete mode 100644 samples/client/petstore/python-tornado/.openapi-generator-ignore delete mode 100644 samples/client/petstore/python-tornado/.openapi-generator/FILES delete mode 100644 samples/client/petstore/python-tornado/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/python-tornado/.travis.yml delete mode 100644 samples/client/petstore/python-tornado/Makefile delete mode 100644 samples/client/petstore/python-tornado/README.md delete mode 100644 samples/client/petstore/python-tornado/dev-requirements.txt delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/python-tornado/docs/Animal.md delete mode 100644 samples/client/petstore/python-tornado/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/python-tornado/docs/ApiResponse.md delete mode 100644 samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/python-tornado/docs/ArrayTest.md delete mode 100644 samples/client/petstore/python-tornado/docs/BigCat.md delete mode 100644 samples/client/petstore/python-tornado/docs/BigCatAllOf.md delete mode 100644 samples/client/petstore/python-tornado/docs/Capitalization.md delete mode 100644 samples/client/petstore/python-tornado/docs/Cat.md delete mode 100644 samples/client/petstore/python-tornado/docs/CatAllOf.md delete mode 100644 samples/client/petstore/python-tornado/docs/Category.md delete mode 100644 samples/client/petstore/python-tornado/docs/ClassModel.md delete mode 100644 samples/client/petstore/python-tornado/docs/Client.md delete mode 100644 samples/client/petstore/python-tornado/docs/Dog.md delete mode 100644 samples/client/petstore/python-tornado/docs/DogAllOf.md delete mode 100644 samples/client/petstore/python-tornado/docs/EnumArrays.md delete mode 100644 samples/client/petstore/python-tornado/docs/EnumClass.md delete mode 100644 samples/client/petstore/python-tornado/docs/EnumTest.md delete mode 100644 samples/client/petstore/python-tornado/docs/FakeApi.md delete mode 100644 samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/python-tornado/docs/File.md delete mode 100644 samples/client/petstore/python-tornado/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/python-tornado/docs/FormatTest.md delete mode 100644 samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/python-tornado/docs/List.md delete mode 100644 samples/client/petstore/python-tornado/docs/MapTest.md delete mode 100644 samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/python-tornado/docs/Model200Response.md delete mode 100644 samples/client/petstore/python-tornado/docs/ModelReturn.md delete mode 100644 samples/client/petstore/python-tornado/docs/Model_200Response.md delete mode 100644 samples/client/petstore/python-tornado/docs/Model_Return.md delete mode 100644 samples/client/petstore/python-tornado/docs/Name.md delete mode 100644 samples/client/petstore/python-tornado/docs/NumberOnly.md delete mode 100644 samples/client/petstore/python-tornado/docs/Order.md delete mode 100644 samples/client/petstore/python-tornado/docs/OuterComposite.md delete mode 100644 samples/client/petstore/python-tornado/docs/OuterEnum.md delete mode 100644 samples/client/petstore/python-tornado/docs/Pet.md delete mode 100644 samples/client/petstore/python-tornado/docs/PetApi.md delete mode 100644 samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/python-tornado/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/python-tornado/docs/StoreApi.md delete mode 100644 samples/client/petstore/python-tornado/docs/Tag.md delete mode 100644 samples/client/petstore/python-tornado/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/python-tornado/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/python-tornado/docs/User.md delete mode 100644 samples/client/petstore/python-tornado/docs/UserApi.md delete mode 100644 samples/client/petstore/python-tornado/docs/XmlItem.md delete mode 100644 samples/client/petstore/python-tornado/git_push.sh delete mode 100644 samples/client/petstore/python-tornado/petstore_api/__init__.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/__init__.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/fake_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/pet_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/store_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api/user_api.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/api_client.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/configuration.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/exceptions.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/__init__.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_array.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_integer.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_number.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_object.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_string.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/animal.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/api_response.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_test.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/big_cat.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/big_cat_all_of.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/capitalization.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/cat.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/cat_all_of.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/category.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/class_model.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/client.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/dog.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/dog_all_of.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_class.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_test.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/file.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/file_schema_test_class.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/format_test.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/list.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/map_test.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/model200_response.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/model_return.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/name.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/number_only.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/order.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/pet.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/tag.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/user.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/models/xml_item.py delete mode 100644 samples/client/petstore/python-tornado/petstore_api/rest.py delete mode 100644 samples/client/petstore/python-tornado/pom.xml delete mode 100644 samples/client/petstore/python-tornado/requirements.txt delete mode 100644 samples/client/petstore/python-tornado/setup.cfg delete mode 100644 samples/client/petstore/python-tornado/setup.py delete mode 100644 samples/client/petstore/python-tornado/test-requirements.txt delete mode 100644 samples/client/petstore/python-tornado/test/__init__.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_any_type.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_array.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_boolean.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_class.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_integer.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_number.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_object.py delete mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_string.py delete mode 100644 samples/client/petstore/python-tornado/test/test_animal.py delete mode 100644 samples/client/petstore/python-tornado/test/test_another_fake_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_api_response.py delete mode 100644 samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py delete mode 100644 samples/client/petstore/python-tornado/test/test_array_of_number_only.py delete mode 100644 samples/client/petstore/python-tornado/test/test_array_test.py delete mode 100644 samples/client/petstore/python-tornado/test/test_big_cat.py delete mode 100644 samples/client/petstore/python-tornado/test/test_big_cat_all_of.py delete mode 100644 samples/client/petstore/python-tornado/test/test_capitalization.py delete mode 100644 samples/client/petstore/python-tornado/test/test_cat.py delete mode 100644 samples/client/petstore/python-tornado/test/test_cat_all_of.py delete mode 100644 samples/client/petstore/python-tornado/test/test_category.py delete mode 100644 samples/client/petstore/python-tornado/test/test_class_model.py delete mode 100644 samples/client/petstore/python-tornado/test/test_client.py delete mode 100644 samples/client/petstore/python-tornado/test/test_dog.py delete mode 100644 samples/client/petstore/python-tornado/test/test_dog_all_of.py delete mode 100644 samples/client/petstore/python-tornado/test/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-tornado/test/test_enum_class.py delete mode 100644 samples/client/petstore/python-tornado/test/test_enum_test.py delete mode 100644 samples/client/petstore/python-tornado/test/test_fake_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_file.py delete mode 100644 samples/client/petstore/python-tornado/test/test_file_schema_test_class.py delete mode 100644 samples/client/petstore/python-tornado/test/test_format_test.py delete mode 100644 samples/client/petstore/python-tornado/test/test_has_only_read_only.py delete mode 100644 samples/client/petstore/python-tornado/test/test_list.py delete mode 100644 samples/client/petstore/python-tornado/test/test_map_test.py delete mode 100644 samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/client/petstore/python-tornado/test/test_model200_response.py delete mode 100644 samples/client/petstore/python-tornado/test/test_model_200_response.py delete mode 100644 samples/client/petstore/python-tornado/test/test_model_return.py delete mode 100644 samples/client/petstore/python-tornado/test/test_name.py delete mode 100644 samples/client/petstore/python-tornado/test/test_number_only.py delete mode 100644 samples/client/petstore/python-tornado/test/test_order.py delete mode 100644 samples/client/petstore/python-tornado/test/test_outer_composite.py delete mode 100644 samples/client/petstore/python-tornado/test/test_outer_enum.py delete mode 100644 samples/client/petstore/python-tornado/test/test_pet.py delete mode 100644 samples/client/petstore/python-tornado/test/test_pet_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_read_only_first.py delete mode 100644 samples/client/petstore/python-tornado/test/test_special_model_name.py delete mode 100644 samples/client/petstore/python-tornado/test/test_store_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_tag.py delete mode 100644 samples/client/petstore/python-tornado/test/test_type_holder_default.py delete mode 100644 samples/client/petstore/python-tornado/test/test_type_holder_example.py delete mode 100644 samples/client/petstore/python-tornado/test/test_user.py delete mode 100644 samples/client/petstore/python-tornado/test/test_user_api.py delete mode 100644 samples/client/petstore/python-tornado/test/test_xml_item.py delete mode 100755 samples/client/petstore/python-tornado/test_python2_and_3.sh delete mode 100644 samples/client/petstore/python-tornado/testfiles/foo.png delete mode 100644 samples/client/petstore/python-tornado/tests/__init__.py delete mode 100644 samples/client/petstore/python-tornado/tests/test_pet_api.py delete mode 100644 samples/client/petstore/python-tornado/tests/util.py delete mode 100644 samples/client/petstore/python-tornado/tox.ini delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION delete mode 100755 samples/openapi3/client/petstore/python-legacy/.gitignore delete mode 100755 samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml delete mode 100755 samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore delete mode 100755 samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES delete mode 100755 samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION delete mode 100755 samples/openapi3/client/petstore/python-legacy/.travis.yml delete mode 100755 samples/openapi3/client/petstore/python-legacy/Makefile delete mode 100755 samples/openapi3/client/petstore/python-legacy/README.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/dev-requirements.txt delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/AllOfWithSingleRef.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Animal.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Cat.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Category.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Client.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/DeprecatedObject.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Dog.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/File.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Foo.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/FooGetDefaultResponse.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/List.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/MapTest.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/Model_200Response.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/Model_Return.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Name.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/ObjectWithDeprecatedFields.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Order.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/OuterObjectWithEnumProperty.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Pet.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/PetApi.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/SingleRefType.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/Tag.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/User.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/docs/UserApi.md delete mode 100755 samples/openapi3/client/petstore/python-legacy/git_push.sh delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/all_of_with_single_ref.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/deprecated_object.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo_get_default_response.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_200_response.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/object_with_deprecated_fields.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_object_with_enum_property.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/single_ref_type.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/pom.xml delete mode 100755 samples/openapi3/client/petstore/python-legacy/requirements.txt delete mode 100755 samples/openapi3/client/petstore/python-legacy/setup.cfg delete mode 100755 samples/openapi3/client/petstore/python-legacy/setup.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/test-requirements.txt delete mode 100755 samples/openapi3/client/petstore/python-legacy/test/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_all_of_with_single_ref.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_animal.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_api_response.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_array_test.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_cat.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_category.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_class_model.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_client.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/test/test_configuration.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_default_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_deprecated_object.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_dog.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_file.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_foo.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_foo_get_default_response.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_format_test.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_list.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_map_test.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_model_200_response.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_model_return.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_name.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_object_with_deprecated_fields.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_order.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_outer_object_with_enum_property.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_pet.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_single_ref_type.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_store_api.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_tag.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_user.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_user_api.py delete mode 100755 samples/openapi3/client/petstore/python-legacy/test_python2.sh delete mode 100755 samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh delete mode 100755 samples/openapi3/client/petstore/python-legacy/tox.ini delete mode 100644 samples/openapi3/client/petstore/python-prior/.gitignore delete mode 100644 samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml delete mode 100644 samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/python-prior/.travis.yml delete mode 100644 samples/openapi3/client/petstore/python-prior/Makefile delete mode 100644 samples/openapi3/client/petstore/python-prior/README.md delete mode 100644 samples/openapi3/client/petstore/python-prior/dev-requirements.txt delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Address.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Animal.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Apple.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/AppleReq.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Banana.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/BananaReq.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/BasquePig.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Cat.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Category.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ChildCat.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Client.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/DanishPig.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Dog.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Drawing.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/EnumClass.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/File.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Foo.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FooObject.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Fruit.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/FruitReq.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/GmFruit.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Legs.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/List.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Mammal.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/MapTest.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Model_Return.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Mole.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Name.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/NullableShape.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Order.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ParentPet.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Pet.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/PetApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Pig.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Readonly.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Shape.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/SomeObject.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/StringEnum.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Tag.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Triangle.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/User.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/UserApi.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Whale.md delete mode 100644 samples/openapi3/client/petstore/python-prior/docs/Zebra.md delete mode 100644 samples/openapi3/client/petstore/python-prior/git_push.sh delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/rest.py delete mode 100644 samples/openapi3/client/petstore/python-prior/petstore_api/signing.py delete mode 100644 samples/openapi3/client/petstore/python-prior/pom.xml delete mode 100644 samples/openapi3/client/petstore/python-prior/requirements.txt delete mode 100644 samples/openapi3/client/petstore/python-prior/setup.cfg delete mode 100644 samples/openapi3/client/petstore/python-prior/setup.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test-requirements.txt delete mode 100644 samples/openapi3/client/petstore/python-prior/test/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_address.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_animal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_api_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_apple.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_apple_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_array_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_banana.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_banana_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_capitalization.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_cat.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_category.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_child_cat.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_class_model.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_client.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_default_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_dog.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_drawing.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_enum_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_file.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_foo.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_foo_object.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_format_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_legs.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_list.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_mammal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_map_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_model_return.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_mole.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_name.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_object_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_order.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_pet.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_pet_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_pig.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_publish_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_readonly.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_shape.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_some_object.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_store_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_stream_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_string_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_tag.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_user.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_user_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_whale.py delete mode 100644 samples/openapi3/client/petstore/python-prior/test/test_zebra.py delete mode 100755 samples/openapi3/client/petstore/python-prior/test_python.sh delete mode 100644 samples/openapi3/client/petstore/python-prior/testfiles/1px_pic1.png delete mode 100644 samples/openapi3/client/petstore/python-prior/testfiles/1px_pic2.png delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py delete mode 100755 samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py delete mode 100755 samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tests_manual/util.py delete mode 100644 samples/openapi3/client/petstore/python-prior/tox.ini diff --git a/bin/configs/python-asyncio.yaml b/bin/configs/python-asyncio.yaml deleted file mode 100644 index e0918c1d48d1..000000000000 --- a/bin/configs/python-asyncio.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: python-legacy -outputDir: samples/client/petstore/python-asyncio -library: asyncio -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy -additionalProperties: - packageName: petstore_api diff --git a/bin/configs/python-legacy-oas2.yaml b/bin/configs/python-legacy-oas2.yaml deleted file mode 100644 index 14003ec2214e..000000000000 --- a/bin/configs/python-legacy-oas2.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: python-legacy -outputDir: samples/client/petstore/python-legacy -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy -additionalProperties: - packageName: petstore_api diff --git a/bin/configs/python-legacy.yaml b/bin/configs/python-legacy.yaml deleted file mode 100644 index 58657e4891aa..000000000000 --- a/bin/configs/python-legacy.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: python-legacy -outputDir: samples/openapi3/client/petstore/python-legacy -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy -additionalProperties: - packageName: petstore_api diff --git a/bin/configs/python-prior-extensions-x-auth-id-alias.yaml b/bin/configs/python-prior-extensions-x-auth-id-alias.yaml deleted file mode 100644 index a017b13b22a1..000000000000 --- a/bin/configs/python-prior-extensions-x-auth-id-alias.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: python-prior -outputDir: samples/openapi3/client/extensions/x-auth-id-alias/python-prior/ -inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/python -additionalProperties: - packageName: x_auth_id_alias diff --git a/bin/configs/python-prior-oas2.yaml b/bin/configs/python-prior-oas2.yaml deleted file mode 100644 index 160afab7d942..000000000000 --- a/bin/configs/python-prior-oas2.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# this file exists because in this file we omit setting disallowAdditionalPropertiesIfNotPresent -# which makes it default to false -# that false setting is needed for composed schemas to work -# Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword. -generatorName: python-prior -outputDir: samples/client/petstore/python-prior -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior -additionalProperties: - packageName: petstore_api diff --git a/bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml b/bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml deleted file mode 100644 index e524b83b4eae..000000000000 --- a/bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: python-prior -outputDir: samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior -additionalProperties: - disallowAdditionalPropertiesIfNotPresent: "true" - packageName: petstore_api diff --git a/bin/configs/python-prior.yaml b/bin/configs/python-prior.yaml deleted file mode 100644 index 11a918d1ad1a..000000000000 --- a/bin/configs/python-prior.yaml +++ /dev/null @@ -1,8 +0,0 @@ -generatorName: python-prior -outputDir: samples/openapi3/client/petstore/python-prior -inputSpec: modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/python-prior -additionalProperties: - packageName: petstore_api - recursionLimit: "1234" - initRequiredVars: false diff --git a/bin/configs/python-tornado.yaml b/bin/configs/python-tornado.yaml deleted file mode 100644 index e7b89865d40d..000000000000 --- a/bin/configs/python-tornado.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: python-legacy -outputDir: samples/client/petstore/python-tornado -library: tornado -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python-legacy -additionalProperties: - packageName: petstore_api diff --git a/docs/generators.md b/docs/generators.md index f0df7558840c..6c1ff33144b8 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -53,9 +53,7 @@ The following generators are available: * [php-dt (beta)](generators/php-dt.md) * [powershell (beta)](generators/powershell.md) * [python](generators/python.md) -* [python-legacy](generators/python-legacy.md) * [python-nextgen](generators/python-nextgen.md) -* [python-prior](generators/python-prior.md) * [r](generators/r.md) * [ruby](generators/ruby.md) * [rust](generators/rust.md) diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md deleted file mode 100644 index 3d0b1165a610..000000000000 --- a/docs/generators/python-legacy.md +++ /dev/null @@ -1,231 +0,0 @@ ---- -title: Documentation for the python-legacy Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | python-legacy | pass this to the generate command after -g | -| generator stability | STABLE | | -| generator type | CLIENT | | -| generator language | Python | | -| generator language version | 2.7 and 3.4+ | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Python client library. | | - -## CONFIG OPTIONS -These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| -|packageName|python package name (convention: snake_case).| |openapi_client| -|packageUrl|python package URL.| |null| -|packageVersion|python package version.| |1.0.0| -|projectName|python project name in setup.py (e.g. petstore-api).| |null| -|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useNose|use the nose test framework| |false| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | - - -## LANGUAGE PRIMITIVES - - - -## RESERVED WORDS - - - -## FEATURE SET - - -### Client Modification Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension -|Authorizations|✗|ToolingExtension -|UserAgent|✗|ToolingExtension -|MockServer|✗|ToolingExtension - -### Data Type Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Custom|✗|OAS2,OAS3 -|Int32|✓|OAS2,OAS3 -|Int64|✓|OAS2,OAS3 -|Float|✓|OAS2,OAS3 -|Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension -|String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 -|Binary|✓|OAS2,OAS3 -|Boolean|✓|OAS2,OAS3 -|Date|✓|OAS2,OAS3 -|DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 -|File|✓|OAS2 -|Uuid|✗| -|Array|✓|OAS2,OAS3 -|Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 -|Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 -|Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension - -### Documentation Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Readme|✓|ToolingExtension -|Model|✓|ToolingExtension -|Api|✓|ToolingExtension - -### Global Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 -|Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 - -### Parameter Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✗|OAS3 - -### Schema Support Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 - -### Security Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 -|OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✗|OAS2,OAS3 -|OAuth2_ClientCredentials|✗|OAS2,OAS3 -|OAuth2_AuthorizationCode|✗|OAS2,OAS3 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✓|OAS2,OAS3 diff --git a/docs/generators/python-prior.md b/docs/generators/python-prior.md deleted file mode 100644 index 82e50b4f4a22..000000000000 --- a/docs/generators/python-prior.md +++ /dev/null @@ -1,235 +0,0 @@ ---- -title: Documentation for the python-prior Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | python-prior | pass this to the generate command after -g | -| generator stability | STABLE | | -| generator type | CLIENT | | -| generator language | Python | | -| generator language version | >=3.6 | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Python client library. | | - -## CONFIG OPTIONS -These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: this option breaks composition and will be removed in 6.0.0
|false| -|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|initRequiredVars|If set to true then the required variables are included as positional arguments in __init__ and _from_openapi_data methods. Note: this can break some composition use cases. To learn more read PR #8802.| |false| -|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| -|packageName|python package name (convention: snake_case).| |openapi_client| -|packageUrl|python package URL.| |null| -|packageVersion|python package version.| |1.0.0| -|projectName|python project name in setup.py (e.g. petstore-api).| |null| -|pythonAttrNoneIfUnset|when accessing unset attribute, return `None` instead of raising `ApiAttributeError`| |false| -|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| -|useNose|use the nose test framework| |false| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | - - -## LANGUAGE PRIMITIVES - - - -## RESERVED WORDS - - - -## FEATURE SET - - -### Client Modification Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension -|Authorizations|✗|ToolingExtension -|UserAgent|✗|ToolingExtension -|MockServer|✗|ToolingExtension - -### Data Type Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Custom|✗|OAS2,OAS3 -|Int32|✓|OAS2,OAS3 -|Int64|✓|OAS2,OAS3 -|Float|✓|OAS2,OAS3 -|Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension -|String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 -|Binary|✓|OAS2,OAS3 -|Boolean|✓|OAS2,OAS3 -|Date|✓|OAS2,OAS3 -|DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 -|File|✓|OAS2 -|Uuid|✗| -|Array|✓|OAS2,OAS3 -|Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 -|Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 -|Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension - -### Documentation Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Readme|✓|ToolingExtension -|Model|✓|ToolingExtension -|Api|✓|ToolingExtension - -### Global Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 -|Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✓|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 - -### Parameter Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✗|OAS3 - -### Schema Support Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 - -### Security Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 -|OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✗|OAS2,OAS3 -|OAuth2_ClientCredentials|✗|OAS2,OAS3 -|OAuth2_AuthorizationCode|✗|OAS2,OAS3 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✓|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index a4f265e20974..1d6f0012a34e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -40,7 +40,6 @@ import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.api.TemplateFileType; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; -import org.openapitools.codegen.languages.PythonPriorClientCodegen; import org.openapitools.codegen.languages.PythonClientCodegen; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -547,7 +546,7 @@ void generateModels(List files, List allModels, List unu ModelMap modelTemplate = modelList.get(0); if (modelTemplate != null && modelTemplate.getModel() != null) { CodegenModel m = modelTemplate.getModel(); - if (m.isAlias && !((config instanceof PythonPriorClientCodegen) || (config instanceof PythonClientCodegen))) { + if (m.isAlias && !(config instanceof PythonClientCodegen)) { // alias to number, string, enum, etc, which should not be generated as model // for PythonClientCodegen, all aliases are generated as models continue; // Don't create user-defined classes for aliases diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java deleted file mode 100644 index b33c6825519f..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements CodegenConfig { - private final Logger LOGGER = LoggerFactory.getLogger(PythonLegacyClientCodegen.class); - - public static final String PACKAGE_URL = "packageUrl"; - public static final String DEFAULT_LIBRARY = "urllib3"; - // nose is a python testing framework, we use pytest if USE_NOSE is unset - public static final String USE_NOSE = "useNose"; - public static final String RECURSION_LIMIT = "recursionLimit"; - public static final String PYTHON_ATTR_NONE_IF_UNSET = "pythonAttrNoneIfUnset"; - - protected String packageUrl; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - protected boolean useNose = Boolean.FALSE; - - protected Map regexModifiers; - - private String testFolder; - - public PythonLegacyClientCodegen() { - super(); - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.BearerToken, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - // clear import mapping (from default generator) as python does not use it - // at the moment - importMapping.clear(); - - supportsInheritance = true; - modelPackage = "models"; - apiPackage = "api"; - outputFolder = "generated-code" + File.separatorChar + "python"; - - modelTemplateFiles.put("model.mustache", ".py"); - apiTemplateFiles.put("api.mustache", ".py"); - - modelTestTemplateFiles.put("model_test.mustache", ".py"); - apiTestTemplateFiles.put("api_test.mustache", ".py"); - - embeddedTemplateDir = templateDir = "python-legacy"; - - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - testFolder = "test"; - - // default HIDE_GENERATION_TIMESTAMP to true - hideGenerationTimestamp = Boolean.TRUE; - - // from https://docs.python.org/3/reference/lexical_analysis.html#keywords - setReservedWordsLowerCase( - Arrays.asList( - // local variable name used in API methods (endpoints) - "all_params", "resource_path", "path_params", "query_params", - "header_params", "form_params", "local_var_files", "body_params", "auth_settings", - // @property - "property", - // python reserved words - "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", - "assert", "else", "if", "pass", "yield", "break", "except", "import", - "print", "class", "exec", "in", "raise", "continue", "finally", "is", - "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", - "False", "async", "await")); - - regexModifiers = new HashMap(); - regexModifiers.put('i', "IGNORECASE"); - regexModifiers.put('l', "LOCALE"); - regexModifiers.put('m', "MULTILINE"); - regexModifiers.put('s', "DOTALL"); - regexModifiers.put('u', "UNICODE"); - regexModifiers.put('x', "VERBOSE"); - - cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).") - .defaultValue("openapi_client")); - cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api).")); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.") - .defaultValue("1.0.0")); - cliOptions.add(new CliOption(PACKAGE_URL, "python package URL.")); - cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, - CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) - .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) - .defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). - defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); - - supportedLibraries.put("urllib3", "urllib3-based client"); - supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); - supportedLibraries.put("tornado", "tornado-based client"); - CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado, urllib3"); - libraryOption.setDefault(DEFAULT_LIBRARY); - cliOptions.add(libraryOption); - setLibrary(DEFAULT_LIBRARY); - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - Boolean excludeTests = false; - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { - setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); - } - - if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME)); - } else { - // default: set project based on package name - // e.g. petstore_api (package name) => petstore-api (project name) - setProjectName(packageName.replaceAll("_", "-")); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { - setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); - } - - additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); - additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); - - if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) { - excludeTests = Boolean.valueOf(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString()); - } - - Boolean generateSourceCodeOnly = false; - if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { - generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); - } - - if (generateSourceCodeOnly) { - // tests in /test - testFolder = packagePath() + File.separatorChar + testFolder; - // api/model docs in /docs - apiDocPath = packagePath() + File.separatorChar + apiDocPath; - modelDocPath = packagePath() + File.separatorChar + modelDocPath; - } - // make api and model doc path available in mustache template - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - if (additionalProperties.containsKey(PACKAGE_URL)) { - setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); - } - - if (additionalProperties.containsKey(USE_NOSE)) { - setUseNose((String) additionalProperties.get(USE_NOSE)); - } - - // check to see if setRecursionLimit is set and whether it's an integer - if (additionalProperties.containsKey(RECURSION_LIMIT)) { - try { - Integer.parseInt((String) additionalProperties.get(RECURSION_LIMIT)); - } catch (NumberFormatException | NullPointerException e) { - throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000."); - } - } - - String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar); - String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar); - - String readmePath = "README.md"; - String readmeTemplate = "README.mustache"; - if (generateSourceCodeOnly) { - readmePath = packagePath() + "_" + readmePath; - readmeTemplate = "README_onlypackage.mustache"; - } - supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); - - if (!generateSourceCodeOnly) { - supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); - supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("setup_cfg.mustache", "", "setup.cfg")); - - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); - supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); - supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); - } - supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); - supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model.mustache", modelPath, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__api.mustache", apiPath, "__init__.py")); - - // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files. - String[] packageNameSplits = packageName.split("\\."); - String currentPackagePath = ""; - for (int i = 0; i < packageNameSplits.length - 1; i++) { - if (i > 0) { - currentPackagePath = currentPackagePath + File.separatorChar; - } - currentPackagePath = currentPackagePath + packageNameSplits[i]; - supportingFiles.add(new SupportingFile("__init__.mustache", currentPackagePath, "__init__.py")); - } - - supportingFiles.add(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py")); - - if (Boolean.FALSE.equals(excludeTests)) { - supportingFiles.add(new SupportingFile("__init__.mustache", testFolder, "__init__.py")); - } - - supportingFiles.add(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); - - if ("asyncio".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packagePath(), "rest.py")); - additionalProperties.put("asyncio", "true"); - } else if ("tornado".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("tornado/rest.mustache", packagePath(), "rest.py")); - additionalProperties.put("tornado", "true"); - } else { - supportingFiles.add(new SupportingFile("rest.mustache", packagePath(), "rest.py")); - } - - modelPackage = this.packageName + "." + modelPackage; - apiPackage = this.packageName + "." + apiPackage; - - } - - @Override - public String toModelImport(String name) { - String modelImport; - if (StringUtils.startsWithAny(name, "import", "from")) { - modelImport = name; - } else { - modelImport = "from "; - if (!"".equals(modelPackage())) { - modelImport += modelPackage() + "."; - } - modelImport += toModelFilename(name) + " import " + name; - } - return modelImport; - } - - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - // process enum in models - return postProcessModelsEnum(objs); - } - - @Override - public void postProcessParameter(CodegenParameter parameter) { - postProcessPattern(parameter.pattern, parameter.vendorExtensions); - } - - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - postProcessPattern(property.pattern, property.vendorExtensions); - } - - /* - * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python - * does not support this in as natural a way so it needs to convert it. See - * https://docs.python.org/2/howto/regex.html#compilation-flags for details. - * - * @param pattern (the String pattern to convert from python to Perl convention) - * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/) - * @return void - * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention - * - * Includes fix for issue #6675 - */ - public void postProcessPattern(String pattern, Map vendorExtensions) { - if (pattern != null) { - int i = pattern.lastIndexOf('/'); - - //Must follow Perl /pattern/modifiers convention - if (pattern.charAt(0) != '/' || i < 2) { - throw new IllegalArgumentException("Pattern must follow the Perl " - + "/pattern/modifiers convention. " + pattern + " is not valid."); - } - - String regex = pattern.substring(1, i).replace("'", "\\'"); - List modifiers = new ArrayList(); - - for (char c : pattern.substring(i).toCharArray()) { - if (regexModifiers.containsKey(c)) { - String modifier = regexModifiers.get(c); - modifiers.add(modifier); - } - } - - vendorExtensions.put("x-regex", regex); - vendorExtensions.put("x-modifiers", modifiers); - } - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "python-legacy"; - } - - @Override - public String getHelp() { - return "Generates a Python client library."; - } - - - @Override - public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath); - } - - @Override - public String toModelDocFilename(String name) { - return toModelName(name); - } - - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - @Override - public String addRegularExpressionDelimiter(String pattern) { - if (StringUtils.isEmpty(pattern)) { - return pattern; - } - - if (!pattern.matches("^/.*")) { - // Perform a negative lookbehind on each `/` to ensure that it is escaped. - return "/" + pattern.replaceAll("(? - * (PEP 0008) Python packages should also have short, all-lowercase names, - * although the use of underscores is discouraged. - * - * @param packageName Package name - * @return Python package name that conforms to PEP 0008 - */ - @SuppressWarnings("static-method") - public String generatePackageName(String packageName) { - return underscore(packageName.replaceAll("[^\\w]+", "")); - } - - @Override - public String generatorLanguageVersion() { return "2.7 and 3.4+"; }; - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = getAdditionalProperties(p); - - return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]"; - } - return super.getTypeDeclaration(p); - } -} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java deleted file mode 100644 index c6d071e3b990..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java +++ /dev/null @@ -1,1521 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.google.common.collect.Sets; -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.CodegenDiscriminator.MappedModel; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.github.curiousoddman.rgxgen.RgxGen; -import com.github.curiousoddman.rgxgen.config.RgxGenOption; -import com.github.curiousoddman.rgxgen.config.RgxGenProperties; - -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.io.File; -import java.util.*; -import java.util.regex.Pattern; -import java.util.regex.Matcher; - -import static org.openapitools.codegen.utils.OnceLogger.once; - -public class PythonPriorClientCodegen extends PythonLegacyClientCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(PythonPriorClientCodegen.class); - - // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. - private Map modelNameToSchemaCache; - private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; - private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; - - public PythonPriorClientCodegen() { - super(); - - embeddedTemplateDir = templateDir = "python-prior"; - - // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. - // In principle, this should be enabled by default for all code generators. However due to limitations - // in other code generators, support needs to be enabled on a case-by-case basis. - supportsAdditionalPropertiesWithComposedSchema = true; - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.BearerToken, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .includeGlobalFeatures( - GlobalFeature.ParameterizedServer - ) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - // needed for type object with additionalProperties: false - typeMapping.put("object", "dict"); - - languageSpecificPrimitives.add("file_type"); - languageSpecificPrimitives.add("none_type"); - - // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG - // this generator uses the following order for endpoint parameters and model properties - // required params/props with no enum of length one - // required params/props with enum of length one (which is used to set a default value as a python named arg value) - // optional params/props with **kwargs in python - cliOptions.remove(4); - - cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC) - .defaultValue(Boolean.FALSE.toString())); - - cliOptions.add(new CliOption(CodegenConstants.INIT_REQUIRED_VARS, CodegenConstants.INIT_REQUIRED_VARS_DESC) - .defaultValue(Boolean.FALSE.toString())); - - // option to change how we process + set the data in the 'additionalProperties' keyword. - CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString()); - Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); - disallowAdditionalPropertiesIfNotPresentOpts.put("false", - "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); - disallowAdditionalPropertiesIfNotPresentOpts.put("true", - "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: "+ - "this option breaks composition and will be removed in 6.0.0" - ); - disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); - cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.STABLE) - .build(); - } - - @Override - public void processOpts() { - this.setLegacyDiscriminatorBehavior(false); - - super.processOpts(); - modelPackage = packageName + "." + "model"; - - supportingFiles.add(new SupportingFile("model_utils.mustache", packagePath(), "model_utils.py")); - - - // add the models and apis folders - supportingFiles.add(new SupportingFile("__init__models.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); - SupportingFile originalInitModel = supportingFiles.stream() - .filter(sf -> sf.getTemplateFile().equals("__init__model.mustache")) - .reduce((a, b) -> { - throw new IllegalStateException("Multiple elements: " + a + ", " + b); - }) - .orElse(null); - supportingFiles.remove(originalInitModel); - supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); - supportingFiles.add(new SupportingFile("__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__init__.py")); - // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. - Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; - List authMethods = fromSecurity(securitySchemeMap); - if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { - supportingFiles.add(new SupportingFile("signing.mustache", packagePath(), "signing.py")); - } - - Boolean generateSourceCodeOnly = false; - if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { - generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); - } - - // default this to true so the python ModelSimple models will be generated - ModelUtils.setGenerateAliasAsModel(true); - LOGGER.info( - "{} is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums", - CodegenConstants.GENERATE_ALIAS_AS_MODEL); - - Boolean attrNoneIfUnset = false; - if (additionalProperties.containsKey(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET)) { - attrNoneIfUnset = Boolean.valueOf(additionalProperties.get(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET).toString()); - } - additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); - - // When the 'additionalProperties' keyword is not present in a OAS schema, allow - // undeclared properties. This is compliant with the JSON schema specification. - // setting this to false is required to have composed schemas work because: - // anyOf SchemaA + SchemaB, requires that props present only in A are accepted in B because in B - // they are additional properties - Boolean disallowAddProps = false; - if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { - disallowAddProps = Boolean.valueOf(additionalProperties.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()); - } - this.setDisallowAdditionalPropertiesIfNotPresent(disallowAddProps); - - Boolean initRequiredVars = false; - if (additionalProperties.containsKey(CodegenConstants.INIT_REQUIRED_VARS)) { - initRequiredVars = Boolean.valueOf(additionalProperties.get(CodegenConstants.INIT_REQUIRED_VARS).toString()); - } - additionalProperties.put("initRequiredVars", initRequiredVars); - - // check library option to ensure only urllib3 is supported - if (!DEFAULT_LIBRARY.equals(getLibrary())) { - throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); - } - } - - /** - * Configures a friendly name for the generator. This will be used by the - * generator to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "python-prior"; - } - - @Override - public Schema unaliasSchema(Schema schema) { - Map allSchemas = ModelUtils.getSchemas(openAPI); - if (allSchemas == null || allSchemas.isEmpty()) { - // skip the warning as the spec can have no model defined - //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'"); - return schema; - } - - if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { - String simpleRef = ModelUtils.getSimpleRef(schema.get$ref()); - if (schemaMapping.containsKey(simpleRef)) { - LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, schemaMapping.get(simpleRef)); - return schema; - } - Schema ref = allSchemas.get(simpleRef); - if (ref == null) { - once(LOGGER).warn("{} is not defined", schema.get$ref()); - return schema; - } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { - // top-level enum class - return schema; - } else if (ModelUtils.isArraySchema(ref)) { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending array - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } else if (ModelUtils.isComposedSchema(ref)) { - return schema; - } else if (ModelUtils.isMapSchema(ref)) { - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property - return schema; // treat it as model - else { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending map - } else { - // treat it as a typical map - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - } else if (ModelUtils.isObjectSchema(ref)) { // model - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property - return schema; - } else { - // free form object (type: object) - if (ModelUtils.hasValidation(ref)) { - return schema; - } else if (!getAllOfDescendants(simpleRef, openAPI).isEmpty()) { - return schema; - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - } else if (ModelUtils.hasValidation(ref)) { - // non object non array non map schemas that have validations - // are returned so we can generate those schemas as models - // we do this to: - // - preserve the validations in that model class in python - // - use those validations when we use this schema in composed oneOf schemas - return schema; - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - return schema; - } - - public String pythonDate(Object dateValue) { - String strValue = null; - if (dateValue instanceof OffsetDateTime) { - OffsetDateTime date = null; - try { - date = (OffsetDateTime) dateValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date` format for value {}", dateValue); - date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = date.format(iso8601Date); - } else { - strValue = dateValue.toString(); - } - return "dateutil_parser('" + strValue + "').date()"; - } - - public String pythonDateTime(Object dateTimeValue) { - String strValue = null; - if (dateTimeValue instanceof OffsetDateTime) { - OffsetDateTime dateTime = null; - try { - dateTime = (OffsetDateTime) dateTimeValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue); - dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = dateTime.format(iso8601DateTime); - } else { - strValue = dateTimeValue.toString(); - } - return "dateutil_parser('" + strValue + "')"; - } - - /** - * Return the default value of the property - * - * @param p OpenAPI property object - * @return string presentation of the default value of the property - */ - @Override - public String toDefaultValue(Schema p) { - // if a variable has no default set and only has one allowed value - // using enum of length == 1 we use that value. Server/client usage: - // python servers: should only use default values for optional params - // python clients: should only use default values for required params - Object defaultObject = null; - if (p.getDefault() != null) { - defaultObject = p.getDefault(); - } else if (p.getEnum() != null && p.getEnum().size() == 1) { - defaultObject = p.getEnum().get(0); - } - - if (defaultObject == null) { - return null; - } - - String defaultValue = defaultObject.toString(); - if (ModelUtils.isDateSchema(p)) { - defaultValue = pythonDate(defaultObject); - } else if (ModelUtils.isDateTimeSchema(p)) { - defaultValue = pythonDateTime(defaultObject); - } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { - defaultValue = ensureQuotes(defaultValue); - } else if (ModelUtils.isBooleanSchema(p)) { - if (!Boolean.valueOf(defaultValue)) { - defaultValue = "False"; - } else { - defaultValue = "True"; - } - } - return defaultValue; - } - - @Override - public String toModelImport(String name) { - // name looks like Cat - return "from " + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); - } - - @Override - @SuppressWarnings("static-method") - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - // fix the imports that each model has, add the module reference to the model - // loops through imports and converts them all - // from 'Pet' to 'from petstore_api.model.pet import Pet' - - OperationMap val = objs.getOperations(); - List operations = val.getOperation(); - for (CodegenOperation operation : operations) { - if (operation.imports.isEmpty()) { - continue; - } - String[] modelNames = operation.imports.toArray(new String[0]); - operation.imports.clear(); - for (String modelName : modelNames) { - operation.imports.add(toModelImport(modelName)); - } - } - return objs; - } - - /*** - * Override with special post-processing for all models. - * we have a custom version of this method to: - * - remove any primitive models that do not contain validations - * these models are unaliased as inline definitions wherever the spec has them as refs - * this means that the generated client does not use these models - * because they are not used we do not write them - * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer - * - * @param objs a map going from the model name to an object holding the model info - * @return the updated objs - */ - @Override - public Map postProcessAllModels(Map objs) { - super.postProcessAllModels(objs); - - List modelsToRemove = new ArrayList<>(); - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - for (String schemaName : allDefinitions.keySet()) { - Schema refSchema = new Schema().$ref("#/components/schemas/" + schemaName); - Schema unaliasedSchema = unaliasSchema(refSchema); - String modelName = toModelName(schemaName); - if (unaliasedSchema.get$ref() == null) { - modelsToRemove.add(modelName); - } else { - ModelsMap objModel = objs.get(modelName); - if (objModel != null) { // to avoid form parameter's models that are not generated (skipFormModel=true) - for (ModelMap model : objModel.getModels()) { - CodegenModel cm = model.getModel(); - String[] importModelNames = cm.imports.toArray(new String[0]); - cm.imports.clear(); - for (String importModelName : importModelNames) { - cm.imports.add(toModelImport(importModelName)); - String globalImportFixer = "globals()['" + importModelName + "'] = " + importModelName; - cm.imports.add(globalImportFixer); - } - } - } - } - } - - for (String modelName : modelsToRemove) { - objs.remove(modelName); - } - - return objs; - } - - /** - * Convert OAS Property object to Codegen Property object - * We have a custom version of this method to always set allowableValues.enumVars on all enum variables - * Together with unaliasSchema this sets primitive types with validations as models - * This method is used by fromResponse - * - * @param name name of the property - * @param p OAS property object - * @return Codegen Property object - */ - @Override - public CodegenProperty fromProperty(String name, Schema p, boolean required) { - CodegenProperty cp = super.fromProperty(name, p, required); - if (cp.isEnum) { - updateCodegenPropertyEnum(cp); - } - if (cp.isPrimitiveType && p.get$ref() != null) { - cp.complexType = cp.dataType; - } - if (cp.isArray && cp.complexType == null && cp.mostInnerItems.complexType != null) { - cp.complexType = cp.mostInnerItems.complexType; - } - return cp; - } - - /** - * Update codegen property's enum by adding "enumVars" (with name and value) - * - * @param var list of CodegenProperty - */ - @Override - public void updateCodegenPropertyEnum(CodegenProperty var) { - // we have a custom version of this method to omit overwriting the defaultValue - Map allowableValues = var.allowableValues; - - // handle array - if (var.mostInnerItems != null) { - allowableValues = var.mostInnerItems.allowableValues; - } - - if (allowableValues == null) { - return; - } - - List values = (List) allowableValues.get("values"); - if (values == null) { - return; - } - - String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; - Schema referencedSchema = getModelNameToSchemaCache().get(varDataType); - String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType; - - // put "enumVars" map into `allowableValues", including `name` and `value` - List> enumVars = buildEnumVars(values, dataType); - - // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames - Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); - if (referencedSchema != null) { - extensions = referencedSchema.getExtensions(); - } - updateEnumVarsWithExtensions(enumVars, extensions, dataType); - allowableValues.put("enumVars", enumVars); - // overwriting defaultValue omitted from here - } - - /*** - * We have a custom version of this method to produce links to models when they are - * primitive type (not map, not array, not object) and include validations or are enums - * - * @param body request body - * @param imports import collection - * @param bodyParameterName body parameter name - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { - CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - if (schema.get$ref() == null) { - return cp; - } - Schema unaliasedSchema = unaliasSchema(schema); - CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema, false); - Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType); - Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null; - if (dataTypeMismatch || baseTypeMismatch) { - cp.dataType = unaliasedProp.dataType; - cp.baseType = unaliasedProp.complexType; - } - return cp; - } - - /*** - * Adds the body model schema to the body parameter - * We have a custom version of this method so we can flip forceSimpleRef - * to True based upon the results of unaliasSchema - * With this customization, we ensure that when schemas are passed to getSchemaType - * - if they have ref in them they are a model - * - if they do not have ref in them they are not a model - * - * @param codegenParameter the body parameter - * @param name model schema ref key in components - * @param schema the model schema (not refed) - * @param imports collection of imports - * @param bodyParameterName body parameter name - * @param forceSimpleRef if true use a model reference - */ - @Override - protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { - if (name != null) { - Schema bodySchema = new Schema().$ref("#/components/schemas/" + name); - Schema unaliased = unaliasSchema(bodySchema); - if (unaliased.get$ref() != null) { - forceSimpleRef = true; - } - } - super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef); - - } - - - /** - * Return the sanitized variable name for enum - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized variable name for enum - */ - public String toEnumVarName(String value, String datatype) { - // our enum var names are keys in a python dict, so change spaces to underscores - if (value.length() == 0) { - return "EMPTY"; - } - - String var = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT); - return var; - } - - /** - * Return the enum value in the language specified format - * e.g. status becomes "status" - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized value for enum - */ - public String toEnumValue(String value, String datatype) { - if ("int".equals(datatype) || "float".equals(datatype)) { - return value; - } else if ("bool".equals(datatype)) { - return value.substring(0, 1).toUpperCase(Locale.ROOT) + value.substring(1); - } else { - return ensureQuotes(value); - } - } - - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { - postProcessPattern(p.pattern, p.vendorExtensions); - // set property.complexType so the model docs will link to the ClassName.md - if (p.complexType == null && p.isArray && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { - // fix ListContainers - p.complexType = p.mostInnerItems.complexType; - } - } - - @Override - public void postProcessParameter(CodegenParameter p) { - postProcessPattern(p.pattern, p.vendorExtensions); - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - p.baseType = null; - } - } - - private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) { - // for composed schema models, if the required properties are only from oneOf or anyOf models - // remove them from the composed schema's required vars - // for composed schemas our code adds oneOf and anyOf required properties to - // the composed schema's required properties - // but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB - // and the required props are only in schemaB, we do not need to use them when making an instance of - // ComposedSchema + schemaA - ComposedSchema cs = (ComposedSchema) schema; - - // these are the properties that are from properties in self cs or cs allOf - Map selfProperties = new LinkedHashMap<>(); - List selfRequired = new ArrayList<>(); - - // these are the properties that are from properties in cs oneOf or cs anyOf - Map otherProperties = new LinkedHashMap<>(); - List otherRequired = new ArrayList<>(); - - List oneOfanyOfSchemas = new ArrayList<>(); - List oneOf = cs.getOneOf(); - if (oneOf != null) { - oneOfanyOfSchemas.addAll(oneOf); - } - List anyOf = cs.getAnyOf(); - if (anyOf != null) { - oneOfanyOfSchemas.addAll(anyOf); - } - for (Schema sc : oneOfanyOfSchemas) { - Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); - addProperties(otherProperties, otherRequired, refSchema, new HashSet<>()); - } - Set otherRequiredSet = new HashSet<>(otherRequired); - - List allOf = cs.getAllOf(); - if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) { - // NOTE: this function also adds the allOf properties inside schema - addProperties(selfProperties, selfRequired, schema, new HashSet<>()); - } - if (result.discriminator != null) { - selfRequired.add(result.discriminator.getPropertyBaseName()); - } - Set selfRequiredSet = new HashSet<>(selfRequired); - - List reqVars = result.getRequiredVars(); - List reqVarsThatMustBeOptional = new ArrayList<>(); - if (reqVars != null) { - for (CodegenProperty cp : reqVars) { - String propName = cp.baseName; - if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) { - cp.required = false; - reqVarsThatMustBeOptional.add(cp); - } - } - } - for (CodegenProperty cp : reqVarsThatMustBeOptional) { - result.getRequiredVars().remove(cp); - result.getOptionalVars().add(cp); - } - } - - /** - * Sets the value of the 'model.parent' property in CodegenModel - * We have a custom version of this function so we can add the dataType on the ArrayModel - */ - @Override - protected void addParentContainer(CodegenModel model, String name, Schema schema) { - super.addParentContainer(model, name, schema); - - List referencedModelNames = new ArrayList<>(); - model.dataType = getTypeString(schema, "", "", referencedModelNames); - } - - /** - * Convert OAS Model object to Codegen Model object - * We have a custom version of this method so we can: - * - set the correct regex values for requiredVars + optionalVars - * - set model.defaultValue and model.hasRequired per the three use cases defined in this method - * - * @param name the name of the model - * @param sc OAS Model object - * @return Codegen Model object - */ - @Override - public CodegenModel fromModel(String name, Schema sc) { - CodegenModel cm = super.fromModel(name, sc); - if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) { - fixComposedSchemaRequiredVars(sc, cm); - } - ArrayList> listOfLists = new ArrayList<>(); - listOfLists.add(cm.requiredVars); - listOfLists.add(cm.optionalVars); - for (List cpList : listOfLists) { - for (CodegenProperty cp : cpList) { - // sets regex values - postProcessModelProperty(cm, cp); - } - } - Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); - if (isNotPythonModelSimpleModel) { - return cm; - } - // Use cases for default values / enums of length one - // 1. no default exists - // schema does not contain default - // cm.defaultValue unset, cm.hasRequired = true - // 2. spec has a default - // schema contains default - // cm.defaultValue set, cm.hasRequired = false - // different value here to differentiate between use case 3 below - // This defaultValue is used when a consumer (client or server) lacks the input argument, defaultValue will be used - // 3. only one value is allowed in an enum - // schema does not contain default - // cm.defaultValue set, cm.hasRequired = false - // because we know what value needs to be set so the user doesn't need to input it - // This defaultValue is used in the client and is sent to the server - String defaultValue = toDefaultValue(sc); - if (sc.getDefault() == null && defaultValue == null) { - cm.hasRequired = true; - } else if (sc.getDefault() != null) { - cm.defaultValue = defaultValue; - cm.hasRequired = false; - } else if (defaultValue != null && cm.defaultValue == null) { - cm.defaultValue = defaultValue; - cm.hasRequired = false; - } - return cm; - } - - /** - * Returns the python type for the property. - * - * @param schema property schema - * @return string presentation of the type - **/ - @SuppressWarnings("static-method") - @Override - public String getSchemaType(Schema schema) { - String openAPIType = getSingleSchemaType(schema); - if (typeMapping.containsKey(openAPIType)) { - String type = typeMapping.get(openAPIType); - return type; - } - return toModelName(openAPIType); - } - - public String getModelName(Schema sc) { - if (sc.get$ref() != null) { - Schema unaliasedSchema = unaliasSchema(sc); - if (unaliasedSchema.get$ref() != null) { - return toModelName(ModelUtils.getSimpleRef(sc.get$ref())); - } - } - return null; - } - - @Override - protected Schema getAdditionalProperties(Schema schema) { - /* - Use cases: - 1. addProps set to schema in spec: return that schema - 2. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent -> null - 3. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent=False -> new Schema() - 4. addProps true -> new Schema() NOTE: v3 only - 5. addprops false -> null NOTE: v3 only - */ - Object addProps = schema.getAdditionalProperties(); - if (addProps instanceof Schema) { - return (Schema) addProps; - } - if (addProps == null) { - // When reaching this code path, this should indicate the 'additionalProperties' keyword is - // not present in the OAS schema. This is true for OAS 3.0 documents. - // However, the parsing logic is broken for OAS 2.0 documents because of the - // https://github.com/swagger-api/swagger-parser/issues/1369 issue. - // When OAS 2.0 documents are parsed, the swagger-v2-converter ignores the 'additionalProperties' - // keyword if the value is boolean. That means codegen is unable to determine whether - // additional properties are allowed or not. - // - // The original behavior was to assume additionalProperties had been set to false. - if (getDisallowAdditionalPropertiesIfNotPresent()) { - // If the 'additionalProperties' keyword is not present in a OAS schema, - // interpret as if the 'additionalProperties' keyword had been set to false. - // This is NOT compliant with the JSON schema specification. It is the original - // 'openapi-generator' behavior. - return null; - } - /* - // The disallowAdditionalPropertiesIfNotPresent CLI option has been set to true, - // but for now that only works with OAS 3.0 documents. - // The new behavior does not work with OAS 2.0 documents. - if (extensions == null || !extensions.containsKey(EXTENSION_OPENAPI_DOC_VERSION)) { - // Fallback to the legacy behavior. - return null; - } - // Get original swagger version from OAS extension. - // Note openAPI.getOpenapi() is always set to 3.x even when the document - // is converted from a OAS/Swagger 2.0 document. - // https://github.com/swagger-api/swagger-parser/pull/1374 - SemVer version = new SemVer((String)extensions.get(EXTENSION_OPENAPI_DOC_VERSION)); - if (version.major != 3) { - return null; - } - */ - } - if (addProps == null || (addProps instanceof Boolean && (Boolean) addProps)) { - // Return empty schema to allow any type - return new Schema(); - } - return null; - } - - /** - * Return a string representation of the Python types for the specified OAS schema. - * Primitive types in the OAS specification are implemented in Python using the corresponding - * Python primitive types. - * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. - *

- * The caller should set the prefix and suffix arguments to empty string, except when - * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified - * to wrap the return value in a python dict, list or tuple. - *

- * Examples: - * - "bool, date, float" The data must be a bool, date or float. - * - "[bool, date]" The data must be an array, and the array items must be a bool or date. - * - * @param p The OAS schema. - * @param prefix prepended to the returned value. - * @param suffix appended to the returned value. - * @param referencedModelNames a list of models that are being referenced while generating the types, - * may be used to generate imports. - * @return a comma-separated string representation of the Python types - */ - private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { - String fullSuffix = suffix; - if (")".equals(suffix)) { - fullSuffix = "," + suffix; - } - if (StringUtils.isNotEmpty(p.get$ref())) { - // The input schema is a reference. If the resolved schema is - // a composed schema, convert the name to a Python class. - Schema unaliasedSchema = unaliasSchema(p); - if (unaliasedSchema.get$ref() != null) { - String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); - if (referencedModelNames != null) { - referencedModelNames.add(modelName); - } - return prefix + modelName + fullSuffix; - } - } - if (ModelUtils.isAnyType(p)) { - // for v2 specs only, swagger-parser never generates an AnyType schemas even though it should generate them - // https://github.com/swagger-api/swagger-parser/issues/1378 - // switch to v3 if you need AnyType to work - return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; - } - String originalSpecVersion = "X"; - if (this.openAPI.getExtensions() != null && this.openAPI.getExtensions().containsKey("x-original-swagger-version")) { - originalSpecVersion = (String) this.openAPI.getExtensions().get("x-original-swagger-version"); - originalSpecVersion = originalSpecVersion.substring(0, 1); - - } - Boolean v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase = (getAdditionalProperties(p) == null && this.getDisallowAdditionalPropertiesIfNotPresent() && originalSpecVersion.equals("2")); - Schema emptySchema = new Schema(); - Boolean v2WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("2")); - if (isFreeFormObject(p) && (v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase || v2WithCompositionAddPropsAnyTypeSchemaCase)) { - // for v2 specs only, input AnyType schemas (type unset) or schema {} results in FreeFromObject schemas - // per https://github.com/swagger-api/swagger-parser/issues/1378 - // v2 spec uses cases - // 1. AnyType schemas - // 2. type object schema with no other info - // use case 1 + 2 -> both become use case 1 - // switch to v3 if you need use cases 1 + 2 to work correctly - return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + fullSuffix; - } - // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. - if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { - fullSuffix = ", none_type" + suffix; - } - Boolean v3WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("3")); - if (isFreeFormObject(p) && v3WithCompositionAddPropsAnyTypeSchemaCase) { - // v3 code path, use case: type object schema with no other schema info - return prefix + "{str: (bool, date, datetime, dict, float, int, list, str, none_type)}" + fullSuffix; - } else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { - Schema inner = getAdditionalProperties(p); - return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - if (inner == null) { - // In OAS 3.0.x, the array "items" attribute is required. - // In OAS >= 3.1, the array "items" attribute is optional such that the OAS - // specification is aligned with the JSON schema specification. - // When "items" is not specified, the elements of the array may be anything at all. - // In that case, the return value should be: - // "[bool, date, datetime, dict, float, int, list, str, none_type]" - // Using recursion to wrap the allowed python types in an array. - Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'. - return getTypeString(anyType, "[", "]", referencedModelNames); - } else { - return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix; - } - } - if (ModelUtils.isFileSchema(p)) { - return prefix + "file_type" + fullSuffix; - } - String baseType = getSchemaType(p); - return prefix + baseType + fullSuffix; - } - - /** - * Output the type declaration of a given name - * - * @param p property schema - * @return a string presentation of the type - */ - @Override - public String getTypeDeclaration(Schema p) { - // this is used to set dataType, which defines a python tuple of classes - // in Python we will wrap this in () to make it a tuple but here we - // will omit the parens so the generated documentation will not include - // them - return getTypeString(p, "", "", null); - } - - @Override - public String toInstantiationType(Schema property) { - if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) { - return getSchemaType(property); - } - return super.toInstantiationType(property); - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - Schema addProps = getAdditionalProperties(schema); - if (addProps != null) { - // if AdditionalProperties exists, get its datatype and - // store it in codegenModel.additionalPropertiesType. - // The 'addProps' may be a reference, getTypeDeclaration will resolve - // the reference. - List referencedModelNames = new ArrayList<>(); - getTypeString(addProps, "", "", referencedModelNames); - if (referencedModelNames.size() != 0) { - // Models that are referenced in the 'additionalPropertiesType' keyword - // must be added to the imports. - codegenModel.imports.addAll(referencedModelNames); - } - } - // If addProps is null, the value of the 'additionalProperties' keyword is set - // to false, i.e. no additional properties are allowed. - } - - /** - * Gets an example if it exists - * - * @param sc input schema - * @return the example value - */ - protected Object getObjectExample(Schema sc) { - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - // TODO handle examples in object models in the future - Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); - if (objectModel) { - return null; - } - if (schema.getExample() != null) { - return schema.getExample(); - } - if (schema.getDefault() != null) { - return schema.getDefault(); - } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - return schema.getEnum().get(0); - } - return null; - } - - /*** - * Ensures that the string has a leading and trailing quote - * - * @param in input string - * @return quoted string - */ - private String ensureQuotes(String in) { - Pattern pattern = Pattern.compile("\r\n|\r|\n"); - Matcher matcher = pattern.matcher(in); - if (matcher.find()) { - // if a string has a new line in it add triple quotes to make it a python multiline string - return "'''" + in + "'''"; - } - String strPattern = "^['\"].*?['\"]$"; - if (in.matches(strPattern)) { - return in; - } - return "\"" + in + "\""; - } - - @Override - public String toExampleValue(Schema schema) { - Object objExample = getObjectExample(schema); - String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); - } - - public String toExampleValue(Schema schema, Object objExample) { - String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); - } - - private Boolean simpleStringSchema(Schema schema) { - Schema sc = schema; - String ref = schema.get$ref(); - if (ref != null) { - sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) { - return true; - } - return false; - } - - private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { - for (MappedModel mm : disc.getMappedModels()) { - String modelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(modelName); - if (ModelUtils.isObjectSchema(modelSchema)) { - return mm; - } - } - return null; - } - - /*** - * Recursively generates string examples for schemas - * - * @param modelName the string name of the refed model that will be generated for the schema or null - * @param schema the schema that we need an example for - * @param objExample the example that applies to this schema, for now only string example are used - * @param indentationLevel integer indentation level that we are currently at - * we assume the indentation amount is 4 spaces times this integer - * @param prefix the string prefix that we will use when assigning an example for this line - * this is used when setting key: value, pairs "key: " is the prefix - * and this is used when setting properties like some_property='some_property_example' - * @param exampleLine this is the current line that we are generating an example for, starts at 0 - * we don't indent the 0th line because using the example value looks like: - * prop = ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * and our example value is: - * ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * @param seenSchemas This set contains all the schemas passed into the recursive function. It is used to check - * if a schema was already passed into the function and breaks the infinite recursive loop. The - * only schemas that are not added are ones that contain $ref != null - * @return the string example - */ - private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, Set seenSchemas) { - final String indentionConst = " "; - String currentIndentation = ""; - String closingIndentation = ""; - for (int i = 0; i < indentationLevel; i++) currentIndentation += indentionConst; - if (exampleLine.equals(0)) { - closingIndentation = currentIndentation; - currentIndentation = ""; - } else { - closingIndentation = currentIndentation; - } - String openChars = ""; - String closeChars = ""; - if (modelName != null) { - openChars = modelName + "("; - closeChars = ")"; - } - - String fullPrefix = currentIndentation + prefix + openChars; - - String example = null; - if (objExample != null) { - example = objExample.toString(); - } - // checks if the current schema has already been passed in. If so, breaks the current recursive pass - if (seenSchemas.contains(schema)) { - if (modelName != null) { - return fullPrefix + closeChars; - } else { - // this is a recursive schema - // need to add a reasonable example to avoid - // infinite recursion - if (ModelUtils.isNullable(schema)) { - // if the schema is nullable, then 'None' is a valid value - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isArraySchema(schema)) { - // the schema is an array, add an empty array - return fullPrefix + "[]" + closeChars; - } else { - // the schema is an object, make an empty object - return fullPrefix + "{}" + closeChars; - } - } - } - - if (null != schema.get$ref()) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - String ref = ModelUtils.getSimpleRef(schema.get$ref()); - Schema refSchema = allDefinitions.get(ref); - if (null == refSchema) { - LOGGER.warn("Unable to find referenced schema {}\n", schema.get$ref()); - return fullPrefix + "None" + closeChars; - } - String refModelName = getModelName(schema); - return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, seenSchemas); - } else if (ModelUtils.isNullType(schema) || ModelUtils.isAnyType(schema)) { - // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, - // though this tooling supports it. - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isBooleanSchema(schema)) { - if (objExample == null) { - example = "True"; - } else { - if ("false".equalsIgnoreCase(objExample.toString())) { - example = "False"; - } else { - example = "True"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isDateSchema(schema)) { - if (objExample == null) { - example = pythonDate("1970-01-01"); - } else { - example = pythonDate(objExample); - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isDateTimeSchema(schema)) { - if (objExample == null) { - example = pythonDateTime("1970-01-01T00:00:00.00Z"); - } else { - example = pythonDateTime(objExample); - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isBinarySchema(schema)) { - if (objExample == null) { - example = "/path/to/file"; - } - example = "open('" + example + "', 'rb')"; - return fullPrefix + example + closeChars; - } else if (ModelUtils.isByteArraySchema(schema)) { - if (objExample == null) { - example = "'YQ=='"; - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isStringSchema(schema)) { - if (objExample == null) { - // a BigDecimal: - if ("Number".equalsIgnoreCase(schema.getFormat())) { - example = "2"; - return fullPrefix + example + closeChars; - } else if (StringUtils.isNotBlank(schema.getPattern())) { - String pattern = schema.getPattern(); - /* - RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 - So strip off the leading /, trailing / and trailing /i, and turn on ignore case if we have it - */ - Pattern valueExtractor = Pattern.compile("^/?(.+?)/?(i?)$"); - Matcher m = valueExtractor.matcher(pattern); - RgxGen rgxGen = null; - if (m.find()) { - int groupCount = m.groupCount(); - if (groupCount == 1) { - // only pattern found - String isolatedPattern = m.group(1); - rgxGen = new RgxGen(isolatedPattern); - } else if (groupCount == 2) { - // patterns and flag found - String isolatedPattern = m.group(1); - String flags = m.group(2); - if (flags.contains("i")) { - rgxGen = new RgxGen(isolatedPattern); - RgxGenProperties properties = new RgxGenProperties(); - RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); - rgxGen.setProperties(properties); - } else { - rgxGen = new RgxGen(isolatedPattern); - } - } - } else { - rgxGen = new RgxGen(pattern); - } - - // this seed makes it so if we have [a-z] we pick a - Random random = new Random(18); - if (rgxGen != null) { - example = rgxGen.generate(random); - } else { - throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); - } - } else if (schema.getMinLength() != null) { - example = ""; - int len = schema.getMinLength().intValue(); - for (int i = 0; i < len; i++) example += "a"; - } else if (ModelUtils.isUUIDSchema(schema)) { - example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; - } else { - example = "string_example"; - } - } - return fullPrefix + ensureQuotes(example) + closeChars; - } else if (ModelUtils.isIntegerSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "1"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isNumberSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "3.14"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isArraySchema(schema)) { - ArraySchema arrayschema = (ArraySchema) schema; - Schema itemSchema = arrayschema.getItems(); - String itemModelName = getModelName(itemSchema); - if (objExample instanceof Iterable && itemModelName == null) { - // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample + closeChars; - } - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - example = fullPrefix + "[" + "\n" + toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + "]" + closeChars; - return example; - } else if (ModelUtils.isMapSchema(schema)) { - if (modelName == null) { - fullPrefix += "{"; - closeChars = "}"; - } - Object addPropsObj = schema.getAdditionalProperties(); - // TODO handle true case for additionalProperties - if (addPropsObj instanceof Schema) { - Schema addPropsSchema = (Schema) addPropsObj; - String key = "key"; - Object addPropsExample = getObjectExample(addPropsSchema); - if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { - key = addPropsSchema.getEnum().get(0).toString(); - } - addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); - String addPropPrefix = key + "="; - if (modelName == null) { - addPropPrefix = ensureQuotes(key) + ": "; - } - String addPropsModelName = getModelName(addPropsSchema); - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + closeChars; - } else { - example = fullPrefix + closeChars; - } - return example; - } else if (ModelUtils.isObjectSchema(schema)) { - if (modelName == null) { - fullPrefix += "{"; - closeChars = "}"; - } - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm != null) { - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - // TODO handle this case in the future, this is when the discriminated - // schema allOf includes this schema, like Cat allOf includes Pet - // so this is the composed schema use case - } else { - return fullPrefix + closeChars; - } - } - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - String exampleForObjectModel = exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); - return exampleForObjectModel; - } else if (ModelUtils.isComposedSchema(schema)) { - // TODO add examples for composed schema models without discriminators - - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm != null) { - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - // Adds schema to seenSchemas before running example model function. removes schema after running - // the function. It also doesn't keep track of any schemas within the ObjectModel. - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - String exampleForObjectModel = exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); - return exampleForObjectModel; - } else { - return fullPrefix + closeChars; - } - } - return fullPrefix + closeChars; - } else { - LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType()); - } - - return example; - } - - private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, Set seenSchemas) { - Map requiredAndOptionalProps = schema.getProperties(); - if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { - return fullPrefix + closeChars; - } - - String example = fullPrefix + "\n"; - for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { - String propName = entry.getKey(); - Schema propSchema = entry.getValue(); - boolean readOnly = false; - if (propSchema.getReadOnly() != null) { - readOnly = propSchema.getReadOnly(); - } - if (readOnly) { - continue; - } - String ref = propSchema.get$ref(); - if (ref != null) { - Schema refSchema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - if (refSchema.getReadOnly() != null) { - readOnly = refSchema.getReadOnly(); - } - if (readOnly) { - continue; - } - } - propName = toVarName(propName); - String propModelName = null; - Object propExample = null; - if (discProp != null && propName.equals(discProp.name)) { - propModelName = null; - propExample = discProp.example; - } else { - propModelName = getModelName(propSchema); - propExample = exampleFromStringOrArraySchema(propSchema, null, propName); - } - example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1, seenSchemas) + ",\n"; - } - // TODO handle additionalProperties also - example += closingIndentation + closeChars; - return example; - } - - private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { - if (currentExample != null) { - return currentExample; - } - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - Object example = getObjectExample(schema); - if (example != null) { - return example; - } else if (simpleStringSchema(schema)) { - return propName + "_example"; - } else if (ModelUtils.isArraySchema(schema)) { - ArraySchema arraySchema = (ArraySchema) schema; - Schema itemSchema = arraySchema.getItems(); - example = getObjectExample(itemSchema); - if (example != null) { - return example; - } else if (simpleStringSchema(itemSchema)) { - return propName + "_example"; - } - } - return null; - } - - - /*** - * - * Set the codegenParameter example value - * We have a custom version of this function so we can invoke toExampleValue - * - * @param codegenParameter the item we are setting the example on - * @param parameter the base parameter that came from the spec - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - Schema schema = parameter.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); - return; - } - - Object example = null; - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - example = codegenParameter.vendorExtensions.get("x-example"); - } else if (parameter.getExample() != null) { - example = parameter.getExample(); - } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { - example = parameter.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); - String finalExample = toExampleValue(schema, example); - codegenParameter.example = finalExample; - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - * @param requestBody Request body - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); - } - - Content content = requestBody.getContent(); - - if (content.size() > 1) { - // @see ModelUtils.getSchemaFromContent() - once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); - } - - MediaType mediaType = content.values().iterator().next(); - Schema schema = mediaType.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema"); - return; - } - - Object example = null; - if (mediaType.getExample() != null) { - example = mediaType.getExample(); - } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) { - example = mediaType.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName); - codegenParameter.example = toExampleValue(schema, example); - } - - /** - * Create a CodegenParameter for a Form Property - * We have a custom version of this method so we can invoke - * setParameterExampleValue(codegenParameter, parameter) - * rather than setParameterExampleValue(codegenParameter) - * This ensures that all of our samples are generated in - * toExampleValueRecursive - * - * @param name the property name - * @param propertySchema the property schema - * @param imports our import set - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { - CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports); - Parameter p = new Parameter(); - p.setSchema(propertySchema); - p.setName(cp.paramName); - setParameterExampleValue(cp, p); - return cp; - } - - /** - * Return a map from model name to Schema for efficient lookup. - * - * @return map from model name to Schema. - */ - protected Map getModelNameToSchemaCache() { - if (modelNameToSchemaCache == null) { - // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap<>(); - ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { - m.put(toModelName(key), schema); - }); - modelNameToSchemaCache = Collections.unmodifiableMap(m); - } - return modelNameToSchemaCache; - } - - @Override - public String generatorLanguageVersion() { return ">=3.6"; }; - - @Override - protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName ) { - // import everything (including child schema of a composed schema) - addImport(model, modelName); - } -} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 4d5a896bcb4c..61c9d8a1d4d0 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -100,11 +100,9 @@ org.openapitools.codegen.languages.PhpMezzioPathHandlerServerCodegen org.openapitools.codegen.languages.PhpDataTransferClientCodegen org.openapitools.codegen.languages.PowerShellClientCodegen org.openapitools.codegen.languages.ProtobufSchemaCodegen -org.openapitools.codegen.languages.PythonLegacyClientCodegen org.openapitools.codegen.languages.PythonNextgenClientCodegen org.openapitools.codegen.languages.PythonClientCodegen org.openapitools.codegen.languages.PythonFastAPIServerCodegen -org.openapitools.codegen.languages.PythonPriorClientCodegen org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen org.openapitools.codegen.languages.PythonBluePlanetServerCodegen diff --git a/modules/openapi-generator/src/main/resources/python-legacy/README.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README.mustache deleted file mode 100644 index ae4af162a148..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/README.mustache +++ /dev/null @@ -1,55 +0,0 @@ -# {{{projectName}}} -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements. - -Python {{{generatorLanguageVersion}}} - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) - -Then import the package: -```python -import {{{packageName}}} -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import {{{packageName}}} -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -{{> common_README }} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache deleted file mode 100644 index 3f7e0860de3d..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache +++ /dev/null @@ -1,43 +0,0 @@ -# {{{projectName}}} -{{#appDescription}} -{{{.}}} -{{/appDescription}} - -The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements. - -Python {{{generatorLanguageVersion}}} - -## Installation & Usage - -This python library package is generated without supporting files like setup.py or requirements files - -To be able to use it, you will need these dependencies in your own package that uses this library: - -* urllib3 >= 1.25.3 -* six >= 1.10 -* python-dateutil -{{#asyncio}} -* aiohttp -{{/asyncio}} -{{#tornado}} -* tornado>=4.2,<5 -{{/tornado}} - -## Getting Started - -In your own code, to use this library to connect and interact with {{{projectName}}}, -you can run the following: - -{{> common_README }} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__.mustache deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache deleted file mode 100644 index c2232a92f4c1..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} -{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache deleted file mode 100644 index 2266b3d17f44..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/__init__model.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -{{>partial_header}} - -from __future__ import absolute_import - -# import models into model package -{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache deleted file mode 100644 index 87a7f612d3ba..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -{{>partial_header}} - -from __future__ import absolute_import - -__version__ = "{{packageVersion}}" - -# import apis into sdk package -{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} -{{/apis}}{{/apiInfo}} -# import ApiClient -from {{packageName}}.api_client import ApiClient -from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import OpenApiException -from {{packageName}}.exceptions import ApiTypeError -from {{packageName}}.exceptions import ApiValueError -from {{packageName}}.exceptions import ApiKeyError -from {{packageName}}.exceptions import ApiAttributeError -from {{packageName}}.exceptions import ApiException -# import models into sdk package -{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} -{{/model}}{{/models}} -{{#recursionLimit}} - -__import__('sys').setrecursionlimit({{{.}}}) -{{/recursionLimit}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache deleted file mode 100644 index 6b4aaf19f62f..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from {{packageName}}.api_client import ApiClient -from {{packageName}}.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -{{#operations}} -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client -{{#operation}} - - def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - -{{#allParams}} - :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} - :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} -{{/allParams}} - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {{returnType}}{{^returnType}}None{{/returnType}} - """ - kwargs['_return_http_data_only'] = True - return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501 - - def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - -{{#allParams}} - :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} - :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} -{{/allParams}} - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {{#returnType}}tuple({{.}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}} - """ - - {{#servers.0}} - local_var_hosts = [ -{{#servers}} - '{{{url}}}'{{^-last}},{{/-last}} -{{/servers}} - ] - local_var_host = local_var_hosts[0] - if kwargs.get('_host_index'): - _host_index = int(kwargs.get('_host_index')) - if _host_index < 0 or _host_index >= len(local_var_hosts): - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" - % len(local_var_host) - ) - local_var_host = local_var_hosts[_host_index] - {{/servers.0}} - local_var_params = locals() - - all_params = [ -{{#allParams}} - '{{paramName}}'{{^-last}},{{/-last}} -{{/allParams}} - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method {{operationId}}" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] -{{#allParams}} -{{^isNullable}} -{{#required}} - # verify the required parameter '{{paramName}}' is set - if self.api_client.client_side_validation and local_var_params.get('{{paramName}}') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 -{{/required}} -{{/isNullable}} -{{/allParams}} - -{{#allParams}} -{{#hasValidation}} - {{#maxLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) > {{maxLength}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 - {{/maxLength}} - {{#minLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) < {{minLength}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 - {{/minLength}} - {{#maximum}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 - {{/maximum}} - {{#minimum}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 - {{/minimum}} - {{#pattern}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 - {{/pattern}} - {{#maxItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) > {{maxItems}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 - {{/maxItems}} - {{#minItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) < {{minItems}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 - {{/minItems}} -{{/hasValidation}} -{{#-last}} -{{/-last}} -{{/allParams}} - collection_formats = {} - - path_params = {} -{{#pathParams}} - if '{{paramName}}' in local_var_params: - path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 -{{/pathParams}} - - query_params = [] -{{#queryParams}} - if local_var_params.get('{{paramName}}') is not None: # noqa: E501 - query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isArray}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 -{{/queryParams}} - - header_params = dict(local_var_params.get('_headers', {})) -{{#headerParams}} - if '{{paramName}}' in local_var_params: - header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 -{{/headerParams}} - - form_params = [] - local_var_files = {} -{{#formParams}} - if '{{paramName}}' in local_var_params: - {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isArray}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 -{{/formParams}} - - body_params = None -{{#bodyParam}} - if '{{paramName}}' in local_var_params: - body_params = local_var_params['{{paramName}}'] -{{/bodyParam}} - {{#hasProduces}} - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) # noqa: E501 - - {{/hasProduces}} - {{#hasConsumes}} - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}], - '{{httpMethod}}', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - {{/hasConsumes}} - # Authentication setting - auth_settings = [{{#authMethods}}'{{name}}'{{^-last}}, {{/-last}}{{/authMethods}}] # noqa: E501 - - {{#returnType}} - {{#responses}} - {{#-first}} - response_types_map = { - {{/-first}} - {{^isWildcard}} - {{code}}: {{#dataType}}"{{.}}"{{/dataType}}{{^dataType}}None{{/dataType}}, - {{/isWildcard}} - {{#-last}} - } - {{/-last}} - {{/responses}} - {{/returnType}} - {{^returnType}} - response_types_map = {} - {{/returnType}} - - return self.api_client.call_api( - '{{{path}}}', '{{httpMethod}}', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - {{#servers.0}} - _host=local_var_host, - {{/servers.0}} - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache deleted file mode 100644 index dd44bb31313a..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache +++ /dev/null @@ -1,725 +0,0 @@ -# coding: utf-8 -{{>partial_header}} -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote -{{#tornado}} -import tornado.gen -{{/tornado}} - -from {{packageName}}.configuration import Configuration -import {{modelPackage}} -from {{packageName}} import rest -from {{packageName}}.exceptions import ApiValueError, ApiException - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' - self.client_side_validation = configuration.client_side_validation - - {{#asyncio}} - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_value, traceback): - await self.close() - {{/asyncio}} - {{^asyncio}} - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - {{/asyncio}} - - {{#asyncio}}async {{/asyncio}}def close(self): - {{#asyncio}} - await self.rest_client.close() - {{/asyncio}} - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - {{#tornado}} - @tornado.gen.coroutine - {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - {{^tornado}} - return return_data - {{/tornado}} - {{#tornado}} - raise tornado.gen.Return(return_data) - {{/tornado}} - - response_type = response_types_map.get(response_data.status, None) - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - -{{^tornado}} - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) -{{/tornado}} -{{#tornado}} - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) -{{/tornado}} - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict['): - sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr({{modelPackage}}, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, queries, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) - - def _apply_auth_params(self, headers, queries, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - kwargs["local_vars_configuration"] = self.configuration - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache deleted file mode 100644 index a9bc6e09bf13..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_doc.mustache +++ /dev/null @@ -1,76 +0,0 @@ -# {{packageName}}.{{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -# **{{{operationId}}}** -> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -### Example - -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} -* Basic Authentication ({{name}}): -{{/isBasicBasic}} -{{#isBasicBearer}} -* Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): -{{/isBasicBearer}} -{{/isBasic}} -{{#isApiKey}} -* Api Key Authentication ({{name}}): -{{/isApiKey }} -{{#isOAuth}} -* OAuth Authentication ({{name}}): -{{/isOAuth }} -{{> api_doc_example }} -{{/authMethods}} -{{/hasAuthMethods}} -{{^hasAuthMethods}} -{{> api_doc_example }} -{{/hasAuthMethods}} -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache deleted file mode 100644 index 526c5950a012..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_doc_example.mustache +++ /dev/null @@ -1,26 +0,0 @@ -```python -from __future__ import print_function -import time -import {{{packageName}}} -from {{{packageName}}}.rest import ApiException -from pprint import pprint -{{> python_doc_auth_partial}} -# Enter a context with an instance of the API client -{{#hasAuthMethods}} -with {{{packageName}}}.ApiClient(configuration) as api_client: -{{/hasAuthMethods}} -{{^hasAuthMethods}} -with {{{packageName}}}.ApiClient() as api_client: -{{/hasAuthMethods}} - # Create an instance of the API class - api_instance = {{{packageName}}}.{{{classname}}}(api_client) - {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/allParams}} - - try: - {{#summary}} # {{{.}}} - {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} - except ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -``` diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache deleted file mode 100644 index a981c662a0d2..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import unittest - -import {{packageName}} -from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 -from {{packageName}}.rest import ApiException - - -class {{#operations}}Test{{classname}}(unittest.TestCase): - """{{classname}} unit test stubs""" - - def setUp(self): - self.api = {{apiPackage}}.{{classFilename}}.{{classname}}() # noqa: E501 - - def tearDown(self): - pass - - {{#operation}} - def test_{{operationId}}(self): - """Test case for {{{operationId}}} - -{{#summary}} - {{{.}}} # noqa: E501 -{{/summary}} - """ - pass - - {{/operation}} -{{/operations}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache deleted file mode 100644 index 61ad3f2ffa34..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache +++ /dev/null @@ -1,239 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import io -import json -import logging -import re -import ssl - -import aiohttp -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode - -from {{packageName}}.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp, data): - self.aiohttp_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = data - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.aiohttp_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - - # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize - - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) - if configuration.cert_file: - ssl_context.load_cert_chain( - configuration.cert_file, keyfile=configuration.key_file - ) - - if not configuration.verify_ssl: - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) - - self.proxy = configuration.proxy - self.proxy_headers = configuration.proxy_headers - - # https pool manager - self.pool_manager = aiohttp.ClientSession( - connector=connector, - trust_env=True - ) - - async def close(self): - await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Execute request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - timeout = _request_timeout or 5 * 60 - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - args = { - "method": method, - "url": url, - "timeout": timeout, - "headers": headers - } - - if self.proxy: - args["proxy"] = self.proxy - if self.proxy_headers: - args["proxy_headers"] = self.proxy_headers - - if query_params: - args["url"] += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body is not None: - body = json.dumps(body) - args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by aiohttp - del headers['Content-Type'] - data = aiohttp.FormData() - for param in post_params: - k, v = param - if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) - else: - data.add_field(k, v) - args["data"] = data - - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - args["data"] = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponse(r, data) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache b/modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache deleted file mode 100644 index 21b5bc89f45d..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/common_README.mustache +++ /dev/null @@ -1,77 +0,0 @@ -```python -from __future__ import print_function -{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} -import time -import {{{packageName}}} -from {{{packageName}}}.rest import ApiException -from pprint import pprint -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -{{> python_doc_auth_partial}} - -# Enter a context with an instance of the API client -{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = {{{packageName}}}.{{{classname}}}(api_client) - {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/allParams}} - - try: - {{#summary}} # {{{.}}} - {{/summary}} {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} - except ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - - -## Documentation For Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{{name}}} - -{{#isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} -{{/isBasic}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache b/modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache deleted file mode 100644 index 7e22b3805fbb..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/configuration.mustache +++ /dev/null @@ -1,646 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import copy -import logging -{{^asyncio}} -import multiprocessing -{{/asyncio}} -import sys -import urllib3 - -import six -from six.moves import http_client as httplib -from {{packageName}}.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. -{{#hasHttpSignatureMethods}} - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration -{{/hasHttpSignatureMethods}} - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - -{{#hasAuthMethods}} - :Example: -{{#hasApiKeyMethods}} - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = {{{packageName}}}.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 -{{/hasApiKeyMethods}} -{{#hasHttpBasicMethods}} - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = {{{packageName}}}.Configuration( - username='the-user', - password='the-password', -) - -{{/hasHttpBasicMethods}} -{{#hasHttpSignatureMethods}} - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the {{{packageName}}}.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is because explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = {{{packageName}}}.Configuration( - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/hasHttpSignatureMethods}} -{{/hasAuthMethods}} - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", -{{#hasHttpSignatureMethods}} - signing_info=None, -{{/hasHttpSignatureMethods}} - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "{{{basePath}}}" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations -{{#hasHttpSignatureMethods}} - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ -{{/hasHttpSignatureMethods}} -{{#hasOAuthMethods}} - self.access_token = None - """access token for OAuth/Bearer - """ -{{/hasOAuthMethods}} -{{^hasOAuthMethods}} -{{#hasHttpBearerMethods}} - self.access_token = None - """access token for OAuth/Bearer - """ -{{/hasHttpBearerMethods}} -{{/hasOAuthMethods}} - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("{{packageName}}") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - {{#asyncio}} - self.connection_pool_maxsize = 100 - """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. - """ - {{/asyncio}} - {{^asyncio}} - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - {{/asyncio}} - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s -{{#hasHttpSignatureMethods}} - if name == "signing_info" and value is not None: - # Ensure the host parameter from signing info is the same as - # Configuration.host. - value.host = self.host -{{/hasHttpSignatureMethods}} - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} -{{#authMethods}} -{{#isApiKey}} - if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}: - auth['{{name}}'] = { - 'type': 'api_key', - 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, - 'key': '{{keyParamName}}', - 'value': self.get_api_key_with_prefix( - '{{name}}',{{#vendorExtensions.x-auth-id-alias}} - alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}} - ), - } -{{/isApiKey}} -{{#isBasic}} - {{#isBasicBasic}} - if self.username is not None and self.password is not None: - auth['{{name}}'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - {{/isBasicBasic}} - {{#isBasicBearer}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'bearer', - 'in': 'header', - {{#bearerFormat}} - 'format': '{{{.}}}', - {{/bearerFormat}} - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - {{/isBasicBearer}} - {{#isHttpSignature}} - if self.signing_info is not None: - auth['{{name}}'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - {{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } -{{/isOAuth}} -{{/authMethods}} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: {{version}}\n"\ - "SDK Package Version: {{packageVersion}}".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - {{#servers}} - { - 'url': "{{{url}}}", - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - 'variables': { - {{/-first}} - '{{{name}}}': { - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - 'default_value': "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - 'enum_values': [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - }{{^-last}},{{/-last}} - {{#-last}} - } - {{/-last}} - {{/variables}} - }{{^-last}},{{/-last}} - {{/servers}} - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache b/modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache deleted file mode 100644 index 6c7726953306..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/exceptions.mustache +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache deleted file mode 100755 index 0e3776ae6dd4..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/gitignore.mustache +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache deleted file mode 100644 index 2cabff63c786..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/gitlab-ci.mustache +++ /dev/null @@ -1,38 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.nosetest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - {{#useNose}} - - nosetests - {{/useNose}} - {{^useNose}} - - pytest --cov={{{packageName}}} - {{/useNose}} - -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest - image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest - image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest - image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest - image: python:3.8-alpine diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model.mustache deleted file mode 100644 index e899b0db336a..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/model.mustache +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from {{packageName}}.configuration import Configuration - - -{{#models}} -{{#model}} -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """{{#allowableValues}} - - """ - allowed enum values - """ -{{#enumVars}} - {{name}} = {{{value}}}{{^-last}} -{{/-last}} -{{/enumVars}}{{/allowableValues}} - -{{#allowableValues}} - allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501 - -{{/allowableValues}} - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { -{{#vars}} - '{{name}}': '{{{dataType}}}'{{^-last}},{{/-last}} -{{/vars}} - } - - attribute_map = { -{{#vars}} - '{{name}}': '{{baseName}}'{{^-last}},{{/-last}} -{{/vars}} - } -{{#discriminator}} - - discriminator_value_class_map = { -{{#children}} - '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} -{{/children}} - } -{{/discriminator}} - - def __init__(self{{#vars}}, {{name}}={{{defaultValue}}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501 - """{{classname}} - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration -{{#vars}}{{#-first}} -{{/-first}} - self._{{name}} = None -{{/vars}} - self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} -{{#vars}}{{#-first}} -{{/-first}} -{{#required}} - self.{{name}} = {{name}} -{{/required}} -{{^required}} -{{#isNullable}} - self.{{name}} = {{name}} -{{/isNullable}} -{{^isNullable}} - if {{name}} is not None: - self.{{name}} = {{name}} -{{/isNullable}} -{{/required}} -{{/vars}} - -{{#vars}} - @property - def {{name}}(self): - """Gets the {{name}} of this {{classname}}. # noqa: E501 - -{{#description}} - {{{.}}} # noqa: E501 -{{/description}} - - :return: The {{name}} of this {{classname}}. # noqa: E501 - :rtype: {{dataType}} - """ - return self._{{name}} - - @{{name}}.setter - def {{name}}(self, {{name}}): - """Sets the {{name}} of this {{classname}}. - -{{#description}} - {{{.}}} # noqa: E501 -{{/description}} - - :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 - :type {{name}}: {{dataType}} - """ -{{^isNullable}} -{{#required}} - if self.local_vars_configuration.client_side_validation and {{name}} is None: # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 -{{/required}} -{{/isNullable}} -{{#isEnum}} -{{#isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 -{{#isArray}} - if (self.local_vars_configuration.client_side_validation and - not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isArray}} -{{#isMap}} - if (self.local_vars_configuration.client_side_validation and - not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isMap}} -{{/isContainer}} -{{^isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if self.local_vars_configuration.client_side_validation and {{{name}}} not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 - .format({{{name}}}, allowed_values) - ) -{{/isContainer}} -{{/isEnum}} -{{^isEnum}} -{{#hasValidation}} -{{#maxLength}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) > {{maxLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 -{{/maxLength}} -{{#minLength}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) < {{minLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 -{{/minLength}} -{{#maximum}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 -{{/maximum}} -{{#minimum}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 -{{/minimum}} -{{#pattern}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 - raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 -{{/pattern}} -{{#maxItems}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) > {{maxItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 -{{/maxItems}} -{{#minItems}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) < {{minItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 -{{/minItems}} -{{/hasValidation}} -{{/isEnum}} - - self._{{name}} = {{name}} - -{{/vars}} -{{#discriminator}} - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - -{{/discriminator}} - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, {{classname}}): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, {{classname}}): - return True - - return self.to_dict() != other.to_dict() -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache deleted file mode 100644 index f73f21259ca9..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/model_doc.mustache +++ /dev/null @@ -1,14 +0,0 @@ -{{#models}}{{#model}}# {{classname}} - -{{#description}}{{&description}} -{{/description}} - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache deleted file mode 100644 index e6fbccf60392..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/model_test.mustache +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import unittest -import datetime - -{{#models}} -{{#model}} -import {{packageName}} -from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501 -from {{packageName}}.rest import ApiException - -class Test{{classname}}(unittest.TestCase): - """{{classname}} unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass -{{^interfaces}} - - def make_instance(self, include_optional): - """Test {{classname}} - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501 - if include_optional : - return {{classname}}( -{{#vars}} - {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}}, {{/-last}} -{{/vars}} - ) - else : - return {{classname}}( -{{#vars}} -{{#required}} - {{name}} = {{{example}}}{{^example}}None{{/example}}, -{{/required}} -{{/vars}} - ) -{{/interfaces}} - - def test{{classname}}(self): - """Test {{classname}}""" -{{^interfaces}} - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) -{{/interfaces}} -{{#interfaces}} -{{#-last}} - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) -{{/-last}} -{{/interfaces}} -{{/model}} -{{/models}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache deleted file mode 100644 index dc3c8f3d8c8a..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/partial_header.mustache +++ /dev/null @@ -1,17 +0,0 @@ -""" -{{#appName}} - {{{.}}} -{{/appName}} - -{{#appDescription}} - {{{.}}} # noqa: E501 -{{/appDescription}} - - {{#version}} - The version of the OpenAPI document: {{{.}}} - {{/version}} - {{#infoEmail}} - Contact: {{{.}}} - {{/infoEmail}} - Generated by: https://openapi-generator.tech -""" diff --git a/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache deleted file mode 100644 index 5106632d214e..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/python_doc_auth_partial.mustache +++ /dev/null @@ -1,109 +0,0 @@ -# Defining the host is optional and defaults to {{{basePath}}} -# See configuration.py for a list of all supported configuration parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) - -{{#hasAuthMethods}} -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} - -# Configure HTTP basic authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) -{{/isBasicBasic}} -{{#isBasicBearer}} - -# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} -configuration = {{{packageName}}}.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) -{{/isBasicBearer}} -{{#isHttpSignature}} - -# Configure HTTP message signature: {{{name}}} -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See {{{packageName}}}.signing for a list of all supported parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}", - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256, - signed_headers = [ - {{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/isHttpSignature}} -{{/isBasic}} -{{#isApiKey}} - -# Configure API key authorization: {{{name}}} -configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['{{name}}'] = 'Bearer' -{{/isApiKey}} -{{#isOAuth}} - -# Configure OAuth2 access token for authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache b/modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache deleted file mode 100644 index d0518ec800e9..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/requirements.mustache +++ /dev/null @@ -1,5 +0,0 @@ -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/modules/openapi-generator/src/main/resources/python-legacy/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/rest.mustache deleted file mode 100644 index 2ca9c473b0a0..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/rest.mustache +++ /dev/null @@ -1,293 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import io -import json -import logging -import re -import ssl - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode -import urllib3 - -from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache b/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache deleted file mode 100644 index efb15b97e7a2..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "{{{projectName}}}" -VERSION = "{{packageVersion}}" -{{#apiInfo}} -{{#apis}} -{{#-last}} -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] -{{#asyncio}} -REQUIRES.append("aiohttp >= 3.0.0") -{{/asyncio}} -{{#tornado}} -REQUIRES.append("tornado>=4.2,<5") -{{/tornado}} - -setup( - name=NAME, - version=VERSION, - description="{{appName}}", - author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", - author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", - url="{{packageUrl}}", - keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - {{#licenseInfo}}license="{{.}}", - {{/licenseInfo}}long_description_content_type='text/markdown', - long_description="""\ - {{appDescription}} # noqa: E501 - """ -) -{{/-last}} -{{/apis}} -{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache deleted file mode 100644 index 931f02c5d14d..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/setup_cfg.mustache +++ /dev/null @@ -1,13 +0,0 @@ -{{#useNose}} -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package={{{packageName}}} -cover-erase=true - -{{/useNose}} -[flake8] -max-line-length=99 diff --git a/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache deleted file mode 100644 index a697e6a9e714..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache +++ /dev/null @@ -1,17 +0,0 @@ -{{#useNose}} -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -{{/useNose}} -{{^useNose}} -pytest~=4.6.7 # needed for python 2.7+3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -{{/useNose}} -{{^asyncio}} -{{^tornado}} -mock; python_version<'3.0' -{{/tornado}} -{{/asyncio}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache deleted file mode 100644 index 2679760ea5bd..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/tornado/rest.mustache +++ /dev/null @@ -1,224 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import io -import json -import logging -import re - -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode -import tornado -import tornado.gen -from tornado import httpclient -from urllib3.filepost import encode_multipart_formdata - -from {{packageName}}.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.tornado_response = resp - self.status = resp.code - self.reason = resp.reason - - if resp.body: - self.data = resp.body - else: - self.data = None - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.tornado_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.tornado_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=4): - # maxsize is number of requests to host that are allowed in parallel - - self.ca_certs = configuration.ssl_ca_cert - self.client_key = configuration.key_file - self.client_cert = configuration.cert_file - - self.proxy_port = self.proxy_host = None - - # https pool manager - if configuration.proxy: - self.proxy_port = 80 - self.proxy_host = configuration.proxy - - self.pool_manager = httpclient.AsyncHTTPClient() - - @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, body=None, - post_params=None, _preload_content=True, - _request_timeout=None): - """Execute Request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - request = httpclient.HTTPRequest(url) - request.allow_nonstandard_methods = True - request.ca_certs = self.ca_certs - request.client_key = self.client_key - request.client_cert = self.client_cert - request.proxy_host = self.proxy_host - request.proxy_port = self.proxy_port - request.method = method - if headers: - request.headers = headers - if 'Content-Type' not in headers: - request.headers['Content-Type'] = 'application/json' - request.request_timeout = _request_timeout or 5 * 60 - - post_params = post_params or {} - - if query_params: - request.url += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body: - body = json.dumps(body) - request.body = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - request.body = urlencode(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - multipart = encode_multipart_formdata(post_params) - request.body, headers['Content-Type'] = multipart - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - request.body = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = yield self.pool_manager.fetch(request, raise_error=False) - - if _preload_content: - - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - raise tornado.gen.Return(r) - - @tornado.gen.coroutine - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - result = yield self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/tox.mustache b/modules/openapi-generator/src/main/resources/python-legacy/tox.mustache deleted file mode 100644 index fe989faf9302..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/tox.mustache +++ /dev/null @@ -1,14 +0,0 @@ -[tox] -{{^asyncio}} -envlist = py27, py3 -{{/asyncio}} -{{#asyncio}} -envlist = py3 -{{/asyncio}} - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} diff --git a/modules/openapi-generator/src/main/resources/python-legacy/travis.mustache b/modules/openapi-generator/src/main/resources/python-legacy/travis.mustache deleted file mode 100644 index 195488737d6b..000000000000 --- a/modules/openapi-generator/src/main/resources/python-legacy/travis.mustache +++ /dev/null @@ -1,22 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -{{#useNose}} -script: nosetests -{{/useNose}} -{{^useNose}} -script: pytest --cov={{{packageName}}} -{{/useNose}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/README.mustache b/modules/openapi-generator/src/main/resources/python-prior/README.mustache deleted file mode 100644 index b0d33e535ac3..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/README.mustache +++ /dev/null @@ -1,55 +0,0 @@ -# {{{projectName}}} -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements. - -Python {{{generatorLanguageVersion}}} - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) - -Then import the package: -```python -import {{{packageName}}} -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import {{{packageName}}} -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -{{> README_common }} diff --git a/modules/openapi-generator/src/main/resources/python-prior/README_common.mustache b/modules/openapi-generator/src/main/resources/python-prior/README_common.mustache deleted file mode 100644 index 97577a411a6b..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/README_common.mustache +++ /dev/null @@ -1,112 +0,0 @@ -```python -{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} -import time -import {{{packageName}}} -from pprint import pprint -{{#apiInfo}} -{{#apis}} -{{#-first}} -from {{apiPackage}} import {{classFilename}} -{{#imports}} -{{{import}}} -{{/imports}} -{{#operations}} -{{#operation}} -{{#-first}} -{{> python_doc_auth_partial}} - -# Enter a context with an instance of the API client -with {{{packageName}}}.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = {{classFilename}}.{{{classname}}}(api_client) - {{#allParams}} - {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/allParams}} - - try: - {{#summary}} # {{{.}}} - {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/-first}} -{{/operation}} -{{/operations}} -{{/-first}} -{{/apis}} -{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - - -## Documentation For Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{{name}}} - -{{#isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in {{{packageName}}}.apis and {{{packageName}}}.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from {{{packageName}}}.api.default_api import DefaultApi` -- `from {{{packageName}}}.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import {{{packageName}}} -from {{{packageName}}}.apis import * -from {{{packageName}}}.models import * -``` diff --git a/modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache deleted file mode 100644 index ba08a3acfea3..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache +++ /dev/null @@ -1,42 +0,0 @@ -# {{{projectName}}} -{{#appDescription}} -{{{.}}} -{{/appDescription}} - -The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements. - -Python {{{generatorLanguageVersion}}} - -## Installation & Usage - -This python library package is generated without supporting files like setup.py or requirements files - -To be able to use it, you will need these dependencies in your own package that uses this library: - -* urllib3 >= 1.25.3 -* python-dateutil -{{#asyncio}} -* aiohttp -{{/asyncio}} -{{#tornado}} -* tornado>=4.2,<5 -{{/tornado}} - -## Getting Started - -In your own code, to use this library to connect and interact with {{{projectName}}}, -you can run the following: - -{{> README_common }} diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__.mustache deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache deleted file mode 100644 index 8a9e6b91b952..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache +++ /dev/null @@ -1,9 +0,0 @@ -{{#apiInfo}} -{{#apis}} -{{#-first}} -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from {{packageName}}.apis import {{classname}} -{{/-first}} -{{/apis}} -{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache deleted file mode 100644 index 76449d186a67..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#apiInfo}} -{{#apis}} -{{#-first}} - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from {{packageName}}.api.{{classFilename}} import {{classname}} -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -{{/-first}} -from {{apiPackage}}.{{classFilename}} import {{classname}} -{{/apis}} -{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache deleted file mode 100644 index b6b698b04528..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# 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 diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache deleted file mode 100644 index 6cbba3113d24..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from {{modelPackage}}.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -{{#models}} -{{#model}} -from {{modelPackage}}.{{classFilename}} import {{classname}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache deleted file mode 100644 index 6308ba683f7f..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache +++ /dev/null @@ -1,26 +0,0 @@ -# flake8: noqa - -{{>partial_header}} - -__version__ = "{{packageVersion}}" - -# import ApiClient -from {{packageName}}.api_client import ApiClient - -# import Configuration -from {{packageName}}.configuration import Configuration -{{#hasHttpSignatureMethods}} -from {{packageName}}.signing import HttpSigningConfiguration -{{/hasHttpSignatureMethods}} - -# import exceptions -from {{packageName}}.exceptions import OpenApiException -from {{packageName}}.exceptions import ApiAttributeError -from {{packageName}}.exceptions import ApiTypeError -from {{packageName}}.exceptions import ApiValueError -from {{packageName}}.exceptions import ApiKeyError -from {{packageName}}.exceptions import ApiException -{{#recursionLimit}} - -__import__('sys').setrecursionlimit({{{.}}}) -{{/recursionLimit}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/api.mustache b/modules/openapi-generator/src/main/resources/python-prior/api.mustache deleted file mode 100644 index a9021cff5aa1..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/api.mustache +++ /dev/null @@ -1,326 +0,0 @@ -{{>partial_header}} - -import re # noqa: F401 -import sys # noqa: F401 - -from {{packageName}}.api_client import ApiClient, Endpoint as _Endpoint -from {{packageName}}.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -{{#imports}} -{{{import}}} -{{/imports}} - - -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client -{{#operations}} -{{#operation}} - self.{{operationId}}_endpoint = _Endpoint( - settings={ - 'response_type': {{#returnType}}({{{.}}},){{/returnType}}{{^returnType}}None{{/returnType}}, -{{#authMethods}} -{{#-first}} - 'auth': [ -{{/-first}} - '{{name}}'{{^-last}},{{/-last}} -{{#-last}} - ], -{{/-last}} -{{/authMethods}} -{{^authMethods}} - 'auth': [], -{{/authMethods}} - 'endpoint_path': '{{{path}}}', - 'operation_id': '{{operationId}}', - 'http_method': '{{httpMethod}}', -{{#servers}} -{{#-first}} - 'servers': [ -{{/-first}} - { - 'url': "{{{url}}}", - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - 'variables': { - {{/-first}} - '{{{name}}}': { - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - 'default_value': "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - 'enum_values': [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - }{{^-last}},{{/-last}} - {{#-last}} - } - {{/-last}} - {{/variables}} - }, -{{#-last}} - ] -{{/-last}} -{{/servers}} -{{^servers}} - 'servers': None, -{{/servers}} - }, - params_map={ - 'all': [ -{{#allParams}} - '{{paramName}}', -{{/allParams}} - ], -{{#requiredParams}} -{{#-first}} - 'required': [ -{{/-first}} - '{{paramName}}', -{{#-last}} - ], -{{/-last}} -{{/requiredParams}} -{{^requiredParams}} - 'required': [], -{{/requiredParams}} - 'nullable': [ -{{#allParams}} -{{#isNullable}} - '{{paramName}}', -{{/isNullable}} -{{/allParams}} - ], - 'enum': [ -{{#allParams}} -{{#isEnum}} - '{{paramName}}', -{{/isEnum}} -{{/allParams}} - ], - 'validation': [ -{{#allParams}} -{{#hasValidation}} - '{{paramName}}', -{{/hasValidation}} -{{/allParams}} - ] - }, - root_map={ - 'validations': { -{{#allParams}} -{{#hasValidation}} - ('{{paramName}}',): { -{{#maxLength}} - 'max_length': {{.}},{{/maxLength}}{{#minLength}} - 'min_length': {{.}},{{/minLength}}{{#maxItems}} - 'max_items': {{.}},{{/maxItems}}{{#minItems}} - 'min_items': {{.}},{{/minItems}}{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}{{^exclusiveMaximum}}'inclusive_maximum'{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}{{^exclusiveMinimum}}'inclusive_minimum'{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - },{{/pattern}} - }, -{{/hasValidation}} -{{/allParams}} - }, - 'allowed_values': { -{{#allParams}} -{{#isEnum}} - ('{{paramName}}',): { -{{#isNullable}} - 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}} - "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} - }, -{{/isEnum}} -{{/allParams}} - }, - 'openapi_types': { -{{#allParams}} - '{{paramName}}': - ({{{dataType}}},), -{{/allParams}} - }, - 'attribute_map': { -{{#allParams}} -{{^isBodyParam}} - '{{paramName}}': '{{baseName}}', -{{/isBodyParam}} -{{/allParams}} - }, - 'location_map': { -{{#allParams}} - '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}', -{{/allParams}} - }, - 'collection_format_map': { -{{#allParams}} -{{#collectionFormat}} - '{{paramName}}': '{{collectionFormat}}', -{{/collectionFormat}} -{{/allParams}} - } - }, - headers_map={ -{{#hasProduces}} - 'accept': [ -{{#produces}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/produces}} - ], -{{/hasProduces}} -{{^hasProduces}} - 'accept': [], -{{/hasProduces}} -{{#hasConsumes}} - 'content_type': [ -{{#consumes}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/consumes}} - ] -{{/hasConsumes}} -{{^hasConsumes}} - 'content_type': [], -{{/hasConsumes}} - }, - api_client=api_client - ) -{{/operation}} -{{/operations}} - -{{#operations}} -{{#operation}} - def {{operationId}}( - self, -{{#requiredParams}} -{{^defaultValue}} - {{paramName}}, -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}}={{{defaultValue}}}, -{{/defaultValue}} -{{/requiredParams}} - **kwargs - ): - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() - -{{#requiredParams}} -{{#-last}} - Args: -{{/-last}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] -{{/defaultValue}} -{{/requiredParams}} - - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {{returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) -{{#requiredParams}} - kwargs['{{paramName}}'] = \ - {{paramName}} -{{/requiredParams}} - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/api_client.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_client.mustache deleted file mode 100644 index 410fa822c604..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/api_client.mustache +++ /dev/null @@ -1,919 +0,0 @@ -{{>partial_header}} - -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField - -{{#tornado}} -import tornado.gen -{{/tornado}} - -from {{packageName}} import rest -from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import ApiTypeError, ApiValueError, ApiException -from {{packageName}}.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - {{#tornado}} - @tornado.gen.coroutine - {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - {{^tornado}} - return (return_data) - {{/tornado}} - {{#tornado}} - raise tornado.gen.Return(return_data) - {{/tornado}} - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - -{{^tornado}} - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) -{{/tornado}} -{{#tornado}} - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) -{{/tornado}} - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, list): - return [cls.sanitize_for_serialization(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(cls.sanitize_for_serialization(item) for item in obj) - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] -{{#hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) -{{/hasHttpSignatureMethods}} - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - 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'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - api_instance = {{classname}}() - api_instance.{{operationId}} # this is an instance of the class Endpoint - api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.{{operationId}}.callable or self.callable in this class -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] - ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) diff --git a/modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache deleted file mode 100644 index 1e8d4c123aba..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache +++ /dev/null @@ -1,79 +0,0 @@ -# {{packageName}}.{{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -# **{{{operationId}}}** -> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}}) - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -### Example - -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} -* Basic Authentication ({{name}}): -{{/isBasicBasic}} -{{#isBasicBearer}} -* Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): -{{/isBasicBearer}} -{{/isBasic}} -{{#isApiKey}} -* Api Key Authentication ({{name}}): -{{/isApiKey }} -{{#isOAuth}} -* OAuth Authentication ({{name}}): -{{/isOAuth }} -{{/authMethods}} -{{/hasAuthMethods}} - -{{> api_doc_example }} - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#requiredParams}}{{^defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | -{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | defaults to {{{.}}} -{{/defaultValue}}{{/requiredParams}}{{#optionalParams}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} -{{/optionalParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache deleted file mode 100644 index 4d6d7bf1dd22..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache +++ /dev/null @@ -1,76 +0,0 @@ -```python -import time -import {{{packageName}}} -from {{apiPackage}} import {{classFilename}} -{{#imports}} -{{{.}}} -{{/imports}} -from pprint import pprint -{{> python_doc_auth_partial}} -# Enter a context with an instance of the API client -{{#hasAuthMethods}} -with {{{packageName}}}.ApiClient(configuration) as api_client: -{{/hasAuthMethods}} -{{^hasAuthMethods}} -with {{{packageName}}}.ApiClient() as api_client: -{{/hasAuthMethods}} - # Create an instance of the API class - api_instance = {{classFilename}}.{{{classname}}}(api_client) -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} -{{/defaultValue}} -{{/requiredParams}} -{{#optionalParams}} - {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} -{{/optionalParams}} -{{#requiredParams}} -{{#-last}} - - # example passing only required values which don't have defaults set - try: -{{#summary}} - # {{{.}}} -{{/summary}} - {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}}) -{{#returnType}} - pprint(api_response) -{{/returnType}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/-last}} -{{/requiredParams}} -{{#optionalParams}} -{{#-last}} - - # example passing only required values which don't have defaults set - # and optional values - try: -{{#summary}} - # {{{.}}} -{{/summary}} - {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{^-last}}, {{/-last}}{{/optionalParams}}) -{{#returnType}} - pprint(api_response) -{{/returnType}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/-last}} -{{/optionalParams}} -{{^requiredParams}} -{{^optionalParams}} - - # example, this endpoint has no required or optional parameters - try: -{{#summary}} - # {{{.}}} -{{/summary}} - {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}() -{{#returnType}} - pprint(api_response) -{{/returnType}} - except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/optionalParams}} -{{/requiredParams}} -``` diff --git a/modules/openapi-generator/src/main/resources/python-prior/api_test.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_test.mustache deleted file mode 100644 index 8f3d764d0a5a..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/api_test.mustache +++ /dev/null @@ -1,32 +0,0 @@ -{{>partial_header}} - -import unittest - -import {{packageName}} -from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 - - -class {{#operations}}Test{{classname}}(unittest.TestCase): - """{{classname}} unit test stubs""" - - def setUp(self): - self.api = {{classname}}() # noqa: E501 - - def tearDown(self): - pass - - {{#operation}} - def test_{{operationId}}(self): - """Test case for {{{operationId}}} - -{{#summary}} - {{{.}}} # noqa: E501 -{{/summary}} - """ - pass - - {{/operation}} -{{/operations}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache deleted file mode 100644 index d69e7fd8312e..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache +++ /dev/null @@ -1,237 +0,0 @@ -{{>partial_header}} - -import io -import json -import logging -import re -import ssl - -import aiohttp -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode - -from {{packageName}}.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp, data): - self.aiohttp_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = data - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.aiohttp_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - - # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize - - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) - if configuration.cert_file: - ssl_context.load_cert_chain( - configuration.cert_file, keyfile=configuration.key_file - ) - - if not configuration.verify_ssl: - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) - - self.proxy = configuration.proxy - self.proxy_headers = configuration.proxy_headers - - # https pool manager - self.pool_manager = aiohttp.ClientSession( - connector=connector, - trust_env=True - ) - - async def close(self): - await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Execute request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - timeout = _request_timeout or 5 * 60 - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - args = { - "method": method, - "url": url, - "timeout": timeout, - "headers": headers - } - - if self.proxy: - args["proxy"] = self.proxy - if self.proxy_headers: - args["proxy_headers"] = self.proxy_headers - - if query_params: - args["url"] += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body is not None: - body = json.dumps(body) - args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by aiohttp - del headers['Content-Type'] - data = aiohttp.FormData() - for param in post_params: - k, v = param - if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) - else: - data.add_field(k, v) - args["data"] = data - - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - args["data"] = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponse(r, data) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) diff --git a/modules/openapi-generator/src/main/resources/python-prior/configuration.mustache b/modules/openapi-generator/src/main/resources/python-prior/configuration.mustache deleted file mode 100644 index 2f85b72ee13f..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/configuration.mustache +++ /dev/null @@ -1,633 +0,0 @@ -{{>partial_header}} - -import copy -import logging -{{^asyncio}} -import multiprocessing -{{/asyncio}} -import sys -import urllib3 - -from http import client as http_client -from {{packageName}}.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. -{{#hasHttpSignatureMethods}} - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration -{{/hasHttpSignatureMethods}} - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - -{{#hasAuthMethods}} - :Example: -{{#hasApiKeyMethods}} - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = {{{packageName}}}.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 -{{/hasApiKeyMethods}} -{{#hasHttpBasicMethods}} - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = {{{packageName}}}.Configuration( - username='the-user', - password='the-password', -) - -{{/hasHttpBasicMethods}} -{{#hasHttpSignatureMethods}} - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the {{{packageName}}}.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is because explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = {{{packageName}}}.Configuration( - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/hasHttpSignatureMethods}} -{{/hasAuthMethods}} - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", -{{#hasHttpSignatureMethods}} - signing_info=None, -{{/hasHttpSignatureMethods}} - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "{{{basePath}}}" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations -{{#hasHttpSignatureMethods}} - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ -{{/hasHttpSignatureMethods}} - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("{{packageName}}") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - {{#asyncio}} - self.connection_pool_maxsize = 100 - """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. - """ - {{/asyncio}} - {{^asyncio}} - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - {{/asyncio}} - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s -{{#hasHttpSignatureMethods}} - if name == "signing_info" and value is not None: - # Ensure the host parameter from signing info is the same as - # Configuration.host. - value.host = self.host -{{/hasHttpSignatureMethods}} - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} -{{#authMethods}} -{{#isApiKey}} - if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}: - auth['{{name}}'] = { - 'type': 'api_key', - 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, - 'key': '{{keyParamName}}', - 'value': self.get_api_key_with_prefix( - '{{name}}',{{#vendorExtensions.x-auth-id-alias}} - alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}} - ), - } -{{/isApiKey}} -{{#isBasic}} - {{#isBasicBasic}} - if self.username is not None and self.password is not None: - auth['{{name}}'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - {{/isBasicBasic}} - {{#isBasicBearer}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'bearer', - 'in': 'header', - {{#bearerFormat}} - 'format': '{{{.}}}', - {{/bearerFormat}} - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - {{/isBasicBearer}} - {{#isHttpSignature}} - if self.signing_info is not None: - auth['{{name}}'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - {{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} - if self.access_token is not None: - auth['{{name}}'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } -{{/isOAuth}} -{{/authMethods}} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: {{version}}\n"\ - "SDK Package Version: {{packageVersion}}".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - {{#servers}} - { - 'url': "{{{url}}}", - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - 'variables': { - {{/-first}} - '{{{name}}}': { - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - 'default_value': "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - 'enum_values': [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - }{{^-last}},{{/-last}} - {{#-last}} - } - {{/-last}} - {{/variables}} - }{{^-last}},{{/-last}} - {{/servers}} - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache b/modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache deleted file mode 100644 index 6e76555cd7d8..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache +++ /dev/null @@ -1,150 +0,0 @@ -{{>partial_header}} - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache deleted file mode 100755 index 0e3776ae6dd4..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache deleted file mode 100644 index cf785a80ab62..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache +++ /dev/null @@ -1,29 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.tests: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - {{#useNose}} - - nosetests - {{/useNose}} - {{^useNose}} - - pytest --cov={{{packageName}}} - {{/useNose}} - -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests - image: python:3.7-alpine -test-3.8: - extends: .tests - image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/modules/openapi-generator/src/main/resources/python-prior/model.mustache b/modules/openapi-generator/src/main/resources/python-prior/model.mustache deleted file mode 100644 index e2e70c837dea..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model.mustache +++ /dev/null @@ -1,58 +0,0 @@ -{{> partial_header }} - -import re # noqa: F401 -import sys # noqa: F401 - -from {{packageName}}.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from {{packageName}}.exceptions import ApiAttributeError - -{{#models}} -{{#model}} -{{#imports}} -{{#-first}} - -def lazy_import(): -{{/-first}} - {{{.}}} -{{/imports}} - - -{{^interfaces}} -{{#isArray}} -{{> model_templates/model_simple }} -{{/isArray}} -{{#isEnum}} -{{> model_templates/model_simple }} -{{/isEnum}} -{{#isAlias}} -{{> model_templates/model_simple }} -{{/isAlias}} -{{^isArray}} -{{^isEnum}} -{{^isAlias}} -{{> model_templates/model_normal }} -{{/isAlias}} -{{/isEnum}} -{{/isArray}} -{{/interfaces}} -{{#interfaces}} -{{#-last}} -{{> model_templates/model_composed }} -{{/-last}} -{{/interfaces}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache deleted file mode 100644 index 3f7c8263df20..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache +++ /dev/null @@ -1,37 +0,0 @@ -{{#models}}{{#model}}# {{classname}} - -{{#description}}{{&description}} -{{/description}} - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#isEnum}} -**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}{{#allowableValues}}{{#defaultValue}}, {{/defaultValue}} must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} -{{/isEnum}} -{{#isAlias}} -**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}} -{{/isAlias}} -{{#isArray}} -**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}}{{#arrayModelType}}[**{{dataType}}**]({{arrayModelType}}.md){{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}} -{{/isArray}} -{{#requiredVars}} -{{^defaultValue}} -**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{#isReadOnly}}[readonly] {{/isReadOnly}} -{{/defaultValue}} -{{/requiredVars}} -{{#requiredVars}} -{{#defaultValue}} -**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}defaults to {{{.}}}{{/defaultValue}} -{{/defaultValue}} -{{/requiredVars}} -{{#optionalVars}} -**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} -{{/optionalVars}} -{{#additionalProperties}} -**any string name** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | any string name can be used but the value must be the correct type | [optional] -{{/additionalProperties}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache deleted file mode 100644 index 0e5ff25b97fb..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache +++ /dev/null @@ -1,138 +0,0 @@ - allowed_values = { -{{#isEnum}} - ('value',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{#requiredVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/requiredVars}} -{{#optionalVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/optionalVars}} - } - - validations = { -{{#hasValidation}} - ('value',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{#requiredVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/requiredVars}} -{{#optionalVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/optionalVars}} - } - -{{#additionalProperties}} - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return ({{{dataType}}},) # noqa: E501 -{{/additionalProperties}} -{{^additionalProperties}} - additional_properties_type = None -{{/additionalProperties}} - - _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { -{{#isAlias}} - 'value': ({{{dataType}}},), -{{/isAlias}} -{{#isEnum}} - 'value': ({{{dataType}}},), -{{/isEnum}} -{{#isArray}} - 'value': ({{{dataType}}},), -{{/isArray}} -{{#requiredVars}} - '{{name}}': ({{{dataType}}},), # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': ({{{dataType}}},), # noqa: E501 -{{/optionalVars}} - } - - @cached_property - def discriminator(): -{{^discriminator}} - return None -{{/discriminator}} -{{#discriminator}} -{{#mappedModels}} -{{#-first}} -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} -{{/-first}} -{{/mappedModels}} - val = { -{{#mappedModels}} - '{{mappingName}}': {{{modelName}}}, -{{/mappedModels}} - } - if not val: - return None - return {'{{{discriminatorName}}}': val}{{/discriminator}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache deleted file mode 100644 index ab20932b2892..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache +++ /dev/null @@ -1,4 +0,0 @@ - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache deleted file mode 100644 index b09f3950b900..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache +++ /dev/null @@ -1,30 +0,0 @@ - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache deleted file mode 100644 index f933b86c5b9d..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache +++ /dev/null @@ -1,7 +0,0 @@ - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache deleted file mode 100644 index d7fa949f7b79..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache +++ /dev/null @@ -1,13 +0,0 @@ - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache deleted file mode 100644 index 3b6993094bdc..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache +++ /dev/null @@ -1,79 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - {{#initRequiredVars}} - def _from_openapi_data(cls{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - {{/initRequiredVars}} - {{^initRequiredVars}} - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - {{/initRequiredVars}} - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - {{#initRequiredVars}} - required_args = { -{{#requiredVars}} - '{{name}}': {{name}}, -{{/requiredVars}} - } - kwargs.update(required_args) - {{/initRequiredVars}} - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache deleted file mode 100644 index 3b82ba7fc3a6..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache +++ /dev/null @@ -1,17 +0,0 @@ -{{> model_templates/method_from_openapi_data_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} - self.{{name}} = {{name}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache deleted file mode 100644 index 9a5f24abf894..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache +++ /dev/null @@ -1,49 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache deleted file mode 100644 index 11f237c074df..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache +++ /dev/null @@ -1,62 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache deleted file mode 100644 index b0d4c5c7bd59..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache +++ /dev/null @@ -1,93 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - {{#initRequiredVars}} - def __init__(self{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - {{/initRequiredVars}} - {{^initRequiredVars}} - def __init__(self, *args, **kwargs): # noqa: E501 - {{/initRequiredVars}} - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - {{#initRequiredVars}} - required_args = { -{{#requiredVars}} - '{{name}}': {{name}}, -{{/requiredVars}} - } - kwargs.update(required_args) - {{/initRequiredVars}} - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache deleted file mode 100644 index bc5e7686f815..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache +++ /dev/null @@ -1,30 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - -{{> model_templates/method_init_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} -{{^isReadOnly}} - self.{{name}} = {{name}} -{{/isReadOnly}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache deleted file mode 100644 index 6d9409098198..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache +++ /dev/null @@ -1,52 +0,0 @@ - @convert_js_args_to_python_args - def __init__(self{{#requiredVars}}{{^isReadOnly}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/isReadOnly}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{^isReadOnly}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/isReadOnly}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache deleted file mode 100644 index ec111f6e7de2..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache +++ /dev/null @@ -1,66 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache deleted file mode 100644 index 8ba0529cd0a6..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache +++ /dev/null @@ -1,51 +0,0 @@ - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache deleted file mode 100644 index ada739e75702..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache +++ /dev/null @@ -1,103 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache deleted file mode 100644 index 8d2f48ea0dfc..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache +++ /dev/null @@ -1,32 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache deleted file mode 100644 index e38832a4a5c8..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache +++ /dev/null @@ -1,34 +0,0 @@ - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.{{#attrNoneIfUnset}}get{{/attrNoneIfUnset}}{{^attrNoneIfUnset}}__getitem__{{/attrNoneIfUnset}}(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache deleted file mode 100644 index 17c441196a93..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache +++ /dev/null @@ -1,24 +0,0 @@ - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache deleted file mode 100644 index 4a7ef6ae5c38..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache +++ /dev/null @@ -1,16 +0,0 @@ - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache deleted file mode 100644 index a6d2277a7330..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache +++ /dev/null @@ -1,74 +0,0 @@ -class {{classname}}(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - -{{> model_templates/method_from_openapi_data_composed }} - -{{> model_templates/method_init_composed }} - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { - 'anyOf': [ -{{#anyOf}} - {{{.}}}, -{{/anyOf}} - ], - 'allOf': [ -{{#allOf}} - {{{.}}}, -{{/allOf}} - ], - 'oneOf': [ -{{#oneOf}} - {{{.}}}, -{{/oneOf}} - ], - } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache deleted file mode 100644 index 513aa01e66e1..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache +++ /dev/null @@ -1,44 +0,0 @@ -class {{classname}}(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - - _composed_schemas = {} - -{{> model_templates/method_from_openapi_data_normal}} - -{{> model_templates/method_init_normal}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache deleted file mode 100644 index 1a41a9cf7e27..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache +++ /dev/null @@ -1,22 +0,0 @@ -class {{classname}}(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - -{{> model_templates/method_init_simple}} - -{{> model_templates/method_from_openapi_data_simple}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache deleted file mode 100644 index 758dc41d9463..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{#maxLength}} - 'max_length': {{.}}, -{{/maxLength}} -{{#minLength}} - 'min_length': {{.}}, -{{/minLength}} -{{#maxItems}} - 'max_items': {{.}}, -{{/maxItems}} -{{#minProperties}} - 'min_properties': {{.}}, -{{/minProperties}} -{{#maxProperties}} - 'max_properties': {{.}}, -{{/maxProperties}} -{{#minItems}} - 'min_items': {{.}}, -{{/minItems}} -{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum': {{maximum}}, -{{/maximum}} -{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum': {{minimum}}, -{{/minimum}} -{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - }, -{{/pattern}} -{{#multipleOf}} - 'multiple_of': {{.}}, -{{/multipleOf}} - }, \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_test.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_test.mustache deleted file mode 100644 index aa95f649441b..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_test.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{>partial_header}} - -import sys -import unittest - -import {{packageName}} -{{#models}} -{{#model}} -{{#imports}} -{{{.}}} -{{/imports}} -from {{modelPackage}}.{{classFilename}} import {{classname}} - - -class Test{{classname}}(unittest.TestCase): - """{{classname}} unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test{{classname}}(self): - """Test {{classname}}""" - # FIXME: construct object with mandatory attributes with example values - # model = {{classname}}() # noqa: E501 - pass - -{{/model}} -{{/models}} - -if __name__ == '__main__': - unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache deleted file mode 100644 index be87a474c795..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache +++ /dev/null @@ -1,1741 +0,0 @@ -{{>partial_header}} - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from {{packageName}}.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - -{{> model_templates/method_set_attribute }} - -{{> model_templates/methods_shared }} - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_tostr_eq_simple }} - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - -{{> model_templates/methods_setattr_getattr_composed }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - 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 variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - 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 variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - 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: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - 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( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache deleted file mode 100644 index dc3c8f3d8c8a..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache +++ /dev/null @@ -1,17 +0,0 @@ -""" -{{#appName}} - {{{.}}} -{{/appName}} - -{{#appDescription}} - {{{.}}} # noqa: E501 -{{/appDescription}} - - {{#version}} - The version of the OpenAPI document: {{{.}}} - {{/version}} - {{#infoEmail}} - Contact: {{{.}}} - {{/infoEmail}} - Generated by: https://openapi-generator.tech -""" diff --git a/modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache deleted file mode 100644 index 5106632d214e..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache +++ /dev/null @@ -1,109 +0,0 @@ -# Defining the host is optional and defaults to {{{basePath}}} -# See configuration.py for a list of all supported configuration parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) - -{{#hasAuthMethods}} -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} - -# Configure HTTP basic authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) -{{/isBasicBasic}} -{{#isBasicBearer}} - -# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} -configuration = {{{packageName}}}.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) -{{/isBasicBearer}} -{{#isHttpSignature}} - -# Configure HTTP message signature: {{{name}}} -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See {{{packageName}}}.signing for a list of all supported parameters. -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}", - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, - signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256, - signed_headers = [ - {{{packageName}}}.signing.HEADER_REQUEST_TARGET, - {{{packageName}}}.signing.HEADER_CREATED, - {{{packageName}}}.signing.HEADER_EXPIRES, - {{{packageName}}}.signing.HEADER_HOST, - {{{packageName}}}.signing.HEADER_DATE, - {{{packageName}}}.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) -{{/isHttpSignature}} -{{/isBasic}} -{{#isApiKey}} - -# Configure API key authorization: {{{name}}} -configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['{{name}}'] = 'Bearer' -{{/isApiKey}} -{{#isOAuth}} - -# Configure OAuth2 access token for authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/requirements.mustache b/modules/openapi-generator/src/main/resources/python-prior/requirements.mustache deleted file mode 100644 index 96947f60408f..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/requirements.mustache +++ /dev/null @@ -1,3 +0,0 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/modules/openapi-generator/src/main/resources/python-prior/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/rest.mustache deleted file mode 100644 index 55ff939b1cf8..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/rest.mustache +++ /dev/null @@ -1,348 +0,0 @@ -{{>partial_header}} - -import io -import json -import logging -import re -import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment -import urllib3 -import ipaddress - -from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/modules/openapi-generator/src/main/resources/python-prior/setup.mustache b/modules/openapi-generator/src/main/resources/python-prior/setup.mustache deleted file mode 100644 index 5f5578256381..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/setup.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>partial_header}} - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "{{{projectName}}}" -VERSION = "{{packageVersion}}" -{{#apiInfo}} -{{#apis}} -{{#-last}} -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", -{{#asyncio}} - "aiohttp >= 3.0.0", -{{/asyncio}} -{{#tornado}} - "tornado>=4.2,<5", -{{/tornado}} -{{#hasHttpSignatureMethods}} - "pem>=19.3.0", - "pycryptodome>=3.9.0", -{{/hasHttpSignatureMethods}} -] - -setup( - name=NAME, - version=VERSION, - description="{{appName}}", - author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", - author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", - url="{{packageUrl}}", - keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires="{{{generatorLanguageVersion}}}", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - {{#licenseInfo}}license="{{.}}", - {{/licenseInfo}}long_description="""\ - {{appDescription}} # noqa: E501 - """ -) -{{/-last}} -{{/apis}} -{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache deleted file mode 100644 index 931f02c5d14d..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache +++ /dev/null @@ -1,13 +0,0 @@ -{{#useNose}} -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package={{{packageName}}} -cover-erase=true - -{{/useNose}} -[flake8] -max-line-length=99 diff --git a/modules/openapi-generator/src/main/resources/python-prior/signing.mustache b/modules/openapi-generator/src/main/resources/python-prior/signing.mustache deleted file mode 100644 index e39866a53dfd..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/signing.mustache +++ /dev/null @@ -1,408 +0,0 @@ -{{>partial_header}} - -from base64 import b64encode -from Crypto.IO import PEM, PKCS8 -from Crypto.Hash import SHA256, SHA512 -from Crypto.PublicKey import RSA, ECC -from Crypto.Signature import PKCS1_v1_5, pss, DSS -from email.utils import formatdate -import json -import os -import re -from time import time -from urllib.parse import urlencode, urlparse - -# The constants below define a subset of HTTP headers that can be included in the -# HTTP signature scheme. Additional headers may be included in the signature. - -# The '(request-target)' header is a calculated field that includes the HTTP verb, -# the URL path and the URL query. -HEADER_REQUEST_TARGET = '(request-target)' -# The time when the HTTP signature was generated. -HEADER_CREATED = '(created)' -# The time when the HTTP signature expires. The API server should reject HTTP requests -# that have expired. -HEADER_EXPIRES = '(expires)' -# The 'Host' header. -HEADER_HOST = 'Host' -# The 'Date' header. -HEADER_DATE = 'Date' -# When the 'Digest' header is included in the HTTP signature, the client automatically -# computes the digest of the HTTP request body, per RFC 3230. -HEADER_DIGEST = 'Digest' -# The 'Authorization' header is automatically generated by the client. It includes -# the list of signed headers and a base64-encoded signature. -HEADER_AUTHORIZATION = 'Authorization' - -# The constants below define the cryptographic schemes for the HTTP signature scheme. -SCHEME_HS2019 = 'hs2019' -SCHEME_RSA_SHA256 = 'rsa-sha256' -SCHEME_RSA_SHA512 = 'rsa-sha512' - -# The constants below define the signature algorithms that can be used for the HTTP -# signature scheme. -ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' -ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' - -ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' -ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' -ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { - ALGORITHM_ECDSA_MODE_FIPS_186_3, - ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 -} - -# The cryptographic hash algorithm for the message signature. -HASH_SHA256 = 'sha256' -HASH_SHA512 = 'sha512' - - -class HttpSigningConfiguration(object): - """The configuration parameters for the HTTP signature security scheme. - The HTTP signature security scheme is used to sign HTTP requests with a private key - which is in possession of the API client. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key. The 'Authorization' header is added to outbound HTTP requests. - - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param key_id: A string value specifying the identifier of the cryptographic key, - when signing HTTP requests. - :param signing_scheme: A string value specifying the signature scheme, when - signing HTTP requests. - Supported value are hs2019, rsa-sha256, rsa-sha512. - Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are - available for server-side applications that only support the older - HTTP signature algorithms. - :param private_key_path: A string value specifying the path of the file containing - a private key. The private key is used to sign HTTP requests. - :param private_key_passphrase: A string value specifying the passphrase to decrypt - the private key. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. - :param signing_algorithm: A string value specifying the signature algorithm, when - signing HTTP requests. - Supported values are: - 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. - 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. - If None, the signing algorithm is inferred from the private key. - The default signing algorithm for RSA keys is RSASSA-PSS. - The default signing algorithm for ECDSA keys is fips-186-3. - :param hash_algorithm: The hash algorithm for the signature. Supported values are - sha256 and sha512. - If the signing_scheme is rsa-sha256, the hash algorithm must be set - to None or sha256. - If the signing_scheme is rsa-sha512, the hash algorithm must be set - to None or sha512. - :param signature_max_validity: The signature max validity, expressed as - a datetime.timedelta value. It must be a positive value. - """ - def __init__(self, key_id, signing_scheme, private_key_path, - private_key_passphrase=None, - signed_headers=None, - signing_algorithm=None, - hash_algorithm=None, - signature_max_validity=None): - self.key_id = key_id - if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: - raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) - self.signing_scheme = signing_scheme - if not os.path.exists(private_key_path): - raise Exception("Private key file does not exist") - self.private_key_path = private_key_path - self.private_key_passphrase = private_key_passphrase - self.signing_algorithm = signing_algorithm - self.hash_algorithm = hash_algorithm - if signing_scheme == SCHEME_RSA_SHA256: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm != HASH_SHA256: - raise Exception("Hash algorithm must be sha256 when security scheme is %s" % - SCHEME_RSA_SHA256) - elif signing_scheme == SCHEME_RSA_SHA512: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA512 - elif self.hash_algorithm != HASH_SHA512: - raise Exception("Hash algorithm must be sha512 when security scheme is %s" % - SCHEME_RSA_SHA512) - elif signing_scheme == SCHEME_HS2019: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: - raise Exception("Invalid hash algorithm") - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - # If the user has not provided any signed_headers, the default must be set to '(created)', - # as specified in the 'HTTP signature' standard. - if signed_headers is None or len(signed_headers) == 0: - signed_headers = [HEADER_CREATED] - if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: - raise Exception( - "Signature max validity must be set when " - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - if HEADER_AUTHORIZATION in signed_headers: - raise Exception("'Authorization' header cannot be included in signed headers") - self.signed_headers = signed_headers - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ - self.host = None - """The host name, optionally followed by a colon and TCP port number. - """ - self._load_private_key() - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_list, request_headers_dict = self._get_signed_header_info( - resource_path, method, headers, body, query_params) - - header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) - b64_signed_msg = self._sign_digest(digest) - - request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( - signed_headers_list, b64_signed_msg) - - return request_headers_dict - - def get_public_key(self): - """Returns the public key object associated with the private key. - """ - pubkey = None - if isinstance(self.private_key, RSA.RsaKey): - pubkey = self.private_key.publickey() - elif isinstance(self.private_key, ECC.EccKey): - pubkey = self.private_key.public_key() - return pubkey - - def _load_private_key(self): - """Load the private key used to sign HTTP requests. - The private key is used to sign HTTP requests as defined in - https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. - """ - if self.private_key is not None: - return - with open(self.private_key_path, 'r') as f: - pem_data = f.read() - # Verify PEM Pre-Encapsulation Boundary - r = re.compile(r"\s*-----BEGIN (.*)-----\s+") - m = r.match(pem_data) - if not m: - raise ValueError("Not a valid PEM pre boundary") - pem_header = m.group(1) - if pem_header == 'RSA PRIVATE KEY': - self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) - elif pem_header == 'EC PRIVATE KEY': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: - # Key is in PKCS8 format, which is capable of holding many different - # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = \ - PEM.decode(pem_data, self.private_key_passphrase) - (oid, privkey, params) = \ - PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) - if oid == '1.2.840.10045.2.1': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - else: - raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) - else: - raise Exception("Unsupported key: {0}".format(pem_header)) - # Validate the specified signature algorithm is compatible with the private key. - if self.signing_algorithm is not None: - supported_algs = None - if isinstance(self.private_key, RSA.RsaKey): - supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} - elif isinstance(self.private_key, ECC.EccKey): - supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS - if supported_algs is not None and self.signing_algorithm not in supported_algs: - raise Exception( - "Signing algorithm {0} is not compatible with private key".format( - self.signing_algorithm)) - - def _get_signed_header_info(self, resource_path, method, headers, body, query_params): - """Build the HTTP headers (name, value) that need to be included in - the HTTP signature scheme. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object (e.g. a dict) representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate - the HTTP signature. - The second dict contains the HTTP headers that must be added to - the outbound HTTP request. - """ - - if body is None: - body = '' - else: - body = json.dumps(body) - - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(self.host).netloc - target_path = urlparse(self.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - request_target += "?" + urlencode(query_params) - - # Get UNIX time, e.g. seconds since epoch, not including leap seconds. - now = time() - # Format date per RFC 7231 section-7.1.1.2. An example is: - # Date: Wed, 21 Oct 2015 07:28:00 GMT - cdate = formatdate(timeval=now, localtime=False, usegmt=True) - # The '(created)' value MUST be a Unix timestamp integer value. - # Subsecond precision is not supported. - created = int(now) - if self.signature_max_validity is not None: - expires = now + self.signature_max_validity.total_seconds() - - signed_headers_list = [] - request_headers_dict = {} - for hdr_key in self.signed_headers: - hdr_key = hdr_key.lower() - if hdr_key == HEADER_REQUEST_TARGET: - value = request_target - elif hdr_key == HEADER_CREATED: - value = '{0}'.format(created) - elif hdr_key == HEADER_EXPIRES: - value = '{0}'.format(expires) - elif hdr_key == HEADER_DATE.lower(): - value = cdate - request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) - elif hdr_key == HEADER_DIGEST.lower(): - request_body = body.encode() - body_digest, digest_prefix = self._get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( - digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == HEADER_HOST.lower(): - value = target_host - request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) - else: - value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) - if value is None: - raise Exception( - "Cannot sign HTTP request. " - "Request does not contain the '{0}' header".format(hdr_key)) - signed_headers_list.append((hdr_key, value)) - - return signed_headers_list, request_headers_dict - - def _get_message_digest(self, data): - """Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of - the HTTP request. - The prefix is a string that identifies the cryptographic hash. It is used - to generate the 'Digest' header as specified in RFC 3230. - """ - if self.hash_algorithm == HASH_SHA512: - digest = SHA512.new() - prefix = 'SHA-512=' - elif self.hash_algorithm == HASH_SHA256: - digest = SHA256.new() - prefix = 'SHA-256=' - else: - raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) - digest.update(data) - return digest, prefix - - def _sign_digest(self, digest): - """Signs a message digest with a private key specified in the signing_info. - - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - sig_alg = self.signing_algorithm - if isinstance(self.private_key, RSA.RsaKey): - if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(self.private_key).sign(digest) - elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(self.private_key).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - elif isinstance(self.private_key, ECC.EccKey): - if sig_alg is None: - sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 - if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: - # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. - # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 - signature = DSS.new(key=self.private_key, mode=sig_alg, - encoding='der').sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - else: - raise Exception("Unsupported private key: {0}".format(type(self.private_key))) - return b64encode(signature) - - def _get_authorization_header(self, signed_headers, signed_msg): - """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of tuples. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ - created_ts = None - expires_ts = None - for k, v in signed_headers: - if k == HEADER_CREATED: - created_ts = v - elif k == HEADER_EXPIRES: - expires_ts = v - lower_keys = [k.lower() for k, v in signed_headers] - headers_value = " ".join(lower_keys) - - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( - self.key_id, self.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( - headers_value, signed_msg.decode('ascii')) - - return auth_str diff --git a/modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache deleted file mode 100644 index 635b816e74b9..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache +++ /dev/null @@ -1,13 +0,0 @@ -{{#useNose}} -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -{{/useNose}} -{{^useNose}} -pytest-cov>=2.8.1 -{{/useNose}} -{{#hasHttpSignatureMethods}} -pycryptodome>=3.9.0 -{{/hasHttpSignatureMethods}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache deleted file mode 100644 index 9e5cc12092d1..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache +++ /dev/null @@ -1,222 +0,0 @@ -{{>partial_header}} - -import io -import json -import logging -import re - -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode -import tornado -import tornado.gen -from tornado import httpclient -from urllib3.filepost import encode_multipart_formdata - -from {{packageName}}.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.tornado_response = resp - self.status = resp.code - self.reason = resp.reason - - if resp.body: - self.data = resp.body - else: - self.data = None - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.tornado_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.tornado_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=4): - # maxsize is number of requests to host that are allowed in parallel - - self.ca_certs = configuration.ssl_ca_cert - self.client_key = configuration.key_file - self.client_cert = configuration.cert_file - - self.proxy_port = self.proxy_host = None - - # https pool manager - if configuration.proxy: - self.proxy_port = 80 - self.proxy_host = configuration.proxy - - self.pool_manager = httpclient.AsyncHTTPClient() - - @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, body=None, - post_params=None, _preload_content=True, - _request_timeout=None): - """Execute Request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - request = httpclient.HTTPRequest(url) - request.allow_nonstandard_methods = True - request.ca_certs = self.ca_certs - request.client_key = self.client_key - request.client_cert = self.client_cert - request.proxy_host = self.proxy_host - request.proxy_port = self.proxy_port - request.method = method - if headers: - request.headers = headers - if 'Content-Type' not in headers: - request.headers['Content-Type'] = 'application/json' - request.request_timeout = _request_timeout or 5 * 60 - - post_params = post_params or {} - - if query_params: - request.url += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body: - body = json.dumps(body) - request.body = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - request.body = urlencode(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - multipart = encode_multipart_formdata(post_params) - request.body, headers['Content-Type'] = multipart - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - request.body = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = yield self.pool_manager.fetch(request, raise_error=False) - - if _preload_content: - - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - raise tornado.gen.Return(r) - - @tornado.gen.coroutine - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - result = yield self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) diff --git a/modules/openapi-generator/src/main/resources/python-prior/tox.mustache b/modules/openapi-generator/src/main/resources/python-prior/tox.mustache deleted file mode 100644 index 4c771c472b8b..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/tox.mustache +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} diff --git a/modules/openapi-generator/src/main/resources/python-prior/travis.mustache b/modules/openapi-generator/src/main/resources/python-prior/travis.mustache deleted file mode 100644 index a26c984f3d22..000000000000 --- a/modules/openapi-generator/src/main/resources/python-prior/travis.mustache +++ /dev/null @@ -1,18 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -{{#useNose}} -script: nosetests -{{/useNose}} -{{^useNose}} -script: pytest --cov={{{packageName}}} -{{/useNose}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java deleted file mode 100644 index f4ed0384bfbf..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.options; - -import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.PythonPriorClientCodegen; - -import java.util.Map; - -public class PythonClientOptionsProvider implements OptionsProvider { - public static final String PACKAGE_NAME_VALUE = "swagger_client_python"; - public static final String PROJECT_NAME_VALUE = "swagger-client-python"; - public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; - public static final String PACKAGE_URL_VALUE = ""; - public static final String USE_NOSE_VALUE = "false"; - public static final String RECURSION_LIMIT = "1200"; - public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "false"; - public static final String PYTHON_ATTR_NONE_IF_UNSET = "false"; - public static final String INIT_REQUIRED_VARS = "false"; - - @Override - public String getLanguage() { - return "python"; - } - - @Override - public Map createOptions() { - ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(PythonPriorClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) - .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) - .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) - .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) - .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") - .put(CodegenConstants.LIBRARY, "urllib3") - .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT) - .put(PythonPriorClientCodegen.USE_NOSE, USE_NOSE_VALUE) - .put(PythonPriorClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) - .put(PythonPriorClientCodegen.PYTHON_ATTR_NONE_IF_UNSET, PYTHON_ATTR_NONE_IF_UNSET) - .put(CodegenConstants.INIT_REQUIRED_VARS, INIT_REQUIRED_VARS) - .build(); - } - - @Override - public boolean isServer() { - return false; - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java deleted file mode 100644 index 90e76caea16f..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonLegacyClientOptionsProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.options; - -import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.PythonLegacyClientCodegen; - -import java.util.Map; - -public class PythonLegacyClientOptionsProvider implements OptionsProvider { - public static final String PACKAGE_NAME_VALUE = "swagger_client_python"; - public static final String PROJECT_NAME_VALUE = "swagger-client-python"; - public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; - public static final String PACKAGE_URL_VALUE = ""; - public static final String USE_NOSE_VALUE = "false"; - public static final String RECURSION_LIMIT = "1200"; - - @Override - public String getLanguage() { - return "python"; - } - - @Override - public Map createOptions() { - ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) - .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) - .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) - .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) - .put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true") - .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") - .put(CodegenConstants.LIBRARY, "urllib3") - .put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE) - .put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) - .build(); - } - - @Override - public boolean isServer() { - return false; - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java deleted file mode 100644 index 28f3d68c0c58..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.python; - -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.PythonLegacyClientCodegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.util.ArrayList; -import java.util.Arrays; - -public class PythonLegacyClientCodegenTest { - - @Test - public void testInitialConfigValues() throws Exception { - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - } - - @Test - public void testSettersForConfigValues() throws Exception { - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - codegen.setHideGenerationTimestamp(false); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - } - - @Test - public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - } - - @Test(description = "test enum null/nullable patterns") - public void testEnumNull() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1997.yaml"); - - StringSchema prop = (StringSchema) openAPI.getComponents().getSchemas().get("Type").getProperties().get("prop"); - ArrayList expected = new ArrayList<>(Arrays.asList("A", "B", "C")); - assert prop.getNullable(); - assert prop.getEnum().equals(expected); - } - - @Test(description = "test regex patterns") - public void testRegularExpressionOpenAPISchemaVersion3() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1517.yaml"); - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - codegen.setOpenAPI(openAPI); - final String path = "/ping"; - final Operation p = openAPI.getPaths().get(path).getGet(); - final CodegenOperation op = codegen.fromOperation(path, "get", p, null); - // pattern_no_forward_slashes '^pattern$' - Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/"); - // pattern_two_slashes '/^pattern$/' - Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/"); - // pattern_dont_escape_backslash '/^pattern\d{3}$/' - Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/"); - // pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/' - Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/"); - // pattern_escape_unescaped_forward_slash '^pattern/\d{3}$' - Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/"); - // pattern_with_modifiers '/^pattern\d{3}$/i - Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); - // pattern_with_backslash_after_bracket '/^[\pattern\d{3}$/i' - // added to test fix for issue #6675 - // removed because "/^[\\pattern\\d{3}$/i" is invalid regex because [ is not escaped and there is no closing ] - // Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i"); - - } - - - - @Test(description = "test generated example values for string properties") - public void testGeneratedExampleValues() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - codegen.setOpenAPI(openAPI); - final Schema dummyUserSchema = openAPI.getComponents().getSchemas().get("DummyUser"); - final Schema nameSchema = (Schema) dummyUserSchema.getProperties().get("name"); - final Schema numberSchema = (Schema) dummyUserSchema.getProperties().get("number"); - final Schema addressSchema = (Schema) dummyUserSchema.getProperties().get("address"); - final String namePattern = codegen.patternCorrection(nameSchema.getPattern()); - final String numberPattern = codegen.patternCorrection(numberSchema.getPattern()); - final String addressPattern = codegen.patternCorrection(addressSchema.getPattern()); - Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(nameSchema)).matches(namePattern)); - Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(numberSchema)).matches(numberPattern)); - Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(addressSchema)).matches(addressPattern)); - } - - @Test(description = "test single quotes escape") - public void testSingleQuotes() { - final PythonLegacyClientCodegen codegen = new PythonLegacyClientCodegen(); - StringSchema schema = new StringSchema(); - schema.setDefault("Text containing 'single' quote"); - String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals("'Text containing \'single\' quote'", defaultValue); - } - - @Test(description = "convert a python model with dots") - public void modelTest() { - final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml"); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - codegen.setOpenAPI(openAPI); - - codegen.setOpenAPI(openAPI); - final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding")); - Assert.assertEquals(simpleName.name, "v1beta3.Binding"); - Assert.assertEquals(simpleName.classname, "V1beta3Binding"); - Assert.assertEquals(simpleName.classVarName, "v1beta3_binding"); - - codegen.setOpenAPI(openAPI); - final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus")); - Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus"); - Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus"); - Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status"); - - final String path = "/api/v1beta3/namespaces/{namespaces}/bindings"; - final Operation operation = openAPI.getPaths().get(path).getPost(); - final CodegenOperation codegenOperation = codegen.fromOperation(path, "get", operation, null); - Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding"); - Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding"); - } - - @Test(description = "convert a simple java model") - public void simpleModelTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addRequiredItem("id") - .addRequiredItem("name"); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 3); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "int"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "int"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.dataType, "str"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "str"); - Assert.assertTrue(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - - final CodegenProperty property3 = cm.vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "datetime"); - Assert.assertEquals(property3.name, "created_at"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "datetime"); - Assert.assertFalse(property3.required); - } - - @Test(description = "convert a model with list property") - public void listPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 2); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "int"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "int"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "urls"); - Assert.assertEquals(property2.dataType, "list[str]"); - Assert.assertEquals(property2.name, "urls"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "list"); - Assert.assertEquals(property2.containerType, "array"); - Assert.assertFalse(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertTrue(property2.isContainer); - } - - @Test(description = "convert a model with a map property") - public void mapPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("translations", new MapSchema() - .additionalProperties(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "translations"); - Assert.assertEquals(property1.dataType, "dict[str, str]"); - Assert.assertEquals(property1.name, "translations"); - Assert.assertEquals(property1.baseType, "dict"); - Assert.assertEquals(property1.containerType, "map"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - Assert.assertTrue(property1.isPrimitiveType); - } - - @Test(description = "convert a model with complex property") - public void complexPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.dataType, "Children"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "Children"); - Assert.assertFalse(property1.required); - Assert.assertFalse(property1.isContainer); - } - - @Test(description = "convert a model with complex list property") - public void complexListPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "list[Children]"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "list"); - Assert.assertEquals(property1.containerType, "array"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - } - - @Test(description = "convert a model with complex map property") - public void complexMapPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "dict[str, Children]"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "dict"); - Assert.assertEquals(property1.containerType, "map"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - } - - - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert an array model") - public void arrayModelTest() { - final Schema model = new ArraySchema() - //.description() - .items(new Schema().$ref("#/definitions/Children")) - .description("an array model"); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, "null"); - Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - } - - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert a map model") - public void mapModelTest() { - final Schema model = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new PythonLegacyClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a map model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, "null"); - Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java deleted file mode 100644 index 8c17cdbb2fd8..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientOptionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.python; - -import org.openapitools.codegen.AbstractOptionsTest; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.PythonLegacyClientCodegen; -import org.openapitools.codegen.options.PythonLegacyClientOptionsProvider; -import org.testng.Assert; - -import java.io.File; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -public class PythonLegacyClientOptionsTest extends AbstractOptionsTest { - private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings); - - public PythonLegacyClientOptionsTest() { - super(new PythonLegacyClientOptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void verifyOptions() { - Assert.assertEquals(clientCodegen.packagePath(), PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar)); - - verify(clientCodegen).setPackageName(PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE); - verify(clientCodegen).setProjectName(PythonLegacyClientOptionsProvider.PROJECT_NAME_VALUE); - verify(clientCodegen).setPackageVersion(PythonLegacyClientOptionsProvider.PACKAGE_VERSION_VALUE); - verify(clientCodegen).setPackageUrl(PythonLegacyClientOptionsProvider.PACKAGE_URL_VALUE); - verify(clientCodegen).setUseNose(PythonLegacyClientOptionsProvider.USE_NOSE_VALUE); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java deleted file mode 100644 index 6c26a85ff905..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.python; - -import org.openapitools.codegen.AbstractOptionsTest; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.PythonPriorClientCodegen; -import org.openapitools.codegen.options.PythonClientOptionsProvider; -import org.testng.Assert; - -import java.io.File; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -public class PythonPriorClientOptionsTest extends AbstractOptionsTest { - private PythonPriorClientCodegen clientCodegen = mock(PythonPriorClientCodegen.class, mockSettings); - - public PythonPriorClientOptionsTest() { - super(new PythonClientOptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void verifyOptions() { - Assert.assertEquals(clientCodegen.packagePath(), PythonClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar)); - - verify(clientCodegen).setPackageName(PythonClientOptionsProvider.PACKAGE_NAME_VALUE); - verify(clientCodegen).setProjectName(PythonClientOptionsProvider.PROJECT_NAME_VALUE); - verify(clientCodegen).setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE); - verify(clientCodegen).setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE); - verify(clientCodegen).setUseNose(PythonClientOptionsProvider.USE_NOSE_VALUE); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java deleted file mode 100644 index e45b037f969b..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.python; -import com.google.common.io.Resources; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import org.openapitools.codegen.config.CodegenConfigurator; - -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.parser.util.SchemaTypeUtil; - -import java.io.File; -import java.math.BigDecimal; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.PythonPriorClientCodegen; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.Assert; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - -@SuppressWarnings("static-method") -public class PythonPriorClientTest { - - @Test(description = "convert a python model with dots") - public void modelTest() { - final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - codegen.setOpenAPI(openAPI); - - codegen.setOpenAPI(openAPI); - final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding")); - Assert.assertEquals(simpleName.name, "v1beta3.Binding"); - Assert.assertEquals(simpleName.classname, "V1beta3Binding"); - Assert.assertEquals(simpleName.classVarName, "v1beta3_binding"); - - codegen.setOpenAPI(openAPI); - final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus")); - Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus"); - Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus"); - Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status"); - - final String path = "/api/v1beta3/namespaces/{namespaces}/bindings"; - final Operation operation = openAPI.getPaths().get(path).getPost(); - final CodegenOperation codegenOperation = codegen.fromOperation(path, "post", operation, null); - Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding"); - Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding"); - } - - @Test(description = "convert a simple java model") - public void simpleModelTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addRequiredItem("id") - .addRequiredItem("name"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 3); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "int"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "int"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.dataType, "str"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "str"); - Assert.assertTrue(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - - final CodegenProperty property3 = cm.vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "datetime"); - Assert.assertEquals(property3.name, "created_at"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "datetime"); - Assert.assertFalse(property3.required); - } - - @Test(description = "convert a model with list property") - public void listPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 2); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "int"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "int"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "urls"); - Assert.assertEquals(property2.dataType, "[str]"); - Assert.assertEquals(property2.name, "urls"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "list"); - Assert.assertEquals(property2.containerType, "array"); - Assert.assertFalse(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertTrue(property2.isContainer); - } - - @Test(description = "convert a model with a map property") - public void mapPropertyTest() { - final Schema model = new Schema() - .description("a sample model") - .addProperties("translations", new MapSchema() - .additionalProperties(new StringSchema())) - .addRequiredItem("id"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "translations"); - Assert.assertEquals(property1.dataType, "{str: (str,)}"); - Assert.assertEquals(property1.name, "translations"); - Assert.assertEquals(property1.baseType, "dict"); - Assert.assertEquals(property1.containerType, "map"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - Assert.assertTrue(property1.isPrimitiveType); - } - - @Test(description = "convert a model with complex property") - public void complexPropertyTest() { - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new Schema().$ref("#/components/schemas/Children")); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.dataType, "Children"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "Children"); - Assert.assertFalse(property1.required); - Assert.assertFalse(property1.isContainer); - } - - @Test(description = "convert a model with complex list property") - public void complexListPropertyTest() { - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children"))); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "[Children]"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "list"); - Assert.assertEquals(property1.containerType, "array"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - } - - @Test(description = "convert a model with complex map property") - public void complexMapPropertyTest() { - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "{str: (Children,)}"); - Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "dict"); - Assert.assertEquals(property1.containerType, "map"); - Assert.assertFalse(property1.required); - Assert.assertTrue(property1.isContainer); - } - - - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert an array model") - public void arrayModelTest() { - final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final Schema model = new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children")) - .description("an array model"); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.classVarName, "sample"); - Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars - Assert.assertEquals(cm.parent, "list"); - Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - - final Map childExample = new HashMap<>(); - childExample.put("number", 3); - final List> example = Arrays.asList(childExample); - String exampleValue = codegen.toExampleValue(model, example); - Assert.assertEquals("[Children(number=1,),]", exampleValue.replaceAll("\\s+","")); - } - - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert a map model") - public void mapModelTest() { - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema sample = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/components/schemas/Children")); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", sample); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", sample); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a map model"); - Assert.assertEquals(cm.vars.size(), 0); - Assert.assertEquals(cm.parent, null); - Assert.assertEquals(cm.imports.size(), 1); - } - - @Test(description = "parse date and date-time example value") - public void parseDateAndDateTimeExamplesTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - - Schema modelSchema = ModelUtils.getSchema(openAPI, "DateTimeTest"); - String defaultValue = codegen.toDefaultValue(modelSchema); - Assert.assertEquals(defaultValue, "dateutil_parser('2010-01-01T10:10:10.000111+01:00')"); - } - - @Test(description = "format imports of models containing special characters") - public void importSpecialModelNameTest() { - final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); - - String importValue = codegen.toModelImport("special.ModelName"); - Assert.assertEquals(importValue, "from models.special_model_name import SpecialModelName"); - } - - @Test(description = "format imports of models containing special characters") - public void defaultSettingInPrimitiveModelWithValidations() { - final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema noDefault = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - final Schema hasDefault = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - hasDefault.setDefault("15.0"); - final Schema noDefaultEumLengthOne = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - noDefaultEumLengthOne.setEnum(Arrays.asList("15.0")); - openAPI.getComponents().addSchemas("noDefaultModel", noDefault); - openAPI.getComponents().addSchemas("hasDefaultModel", hasDefault); - openAPI.getComponents().addSchemas("noDefaultEumLengthOneModel", noDefaultEumLengthOne); - codegen.setOpenAPI(openAPI); - - final CodegenModel noDefaultModel = codegen.fromModel("noDefaultModel", noDefault); - Assert.assertEquals(noDefaultModel.defaultValue, null); - Assert.assertEquals(noDefaultModel.hasRequired, true); - - final CodegenModel hasDefaultModel = codegen.fromModel("hasDefaultModel", hasDefault); - Assert.assertEquals(hasDefaultModel.defaultValue, "15.0"); - Assert.assertEquals(hasDefaultModel.hasRequired, false); - - final CodegenModel noDefaultEumLengthOneModel = codegen.fromModel("noDefaultEumLengthOneModel", noDefaultEumLengthOne); - Assert.assertEquals(noDefaultEumLengthOneModel.defaultValue, "15.0"); - Assert.assertEquals(noDefaultEumLengthOneModel.hasRequired, false); - } - - @Test - public void testObjectModelWithRefedAdditionalPropertiesIsGenerated() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("python") - .setInputSpec("src/test/resources/3_0/issue_7372.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "openapi_client/model/a.py"); - TestUtils.ensureContainsFile(files, output, "openapi_client/model/b.py"); - output.deleteOnExit(); - } - - @Test - public void testFreeFormSchemas() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("python-prior") - .setInputSpec("src/test/resources/3_0/issue_7361.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_with_validation.py"); - TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_interface.py"); - TestUtils.ensureDoesNotContainsFile(files, output, "openapi_client/model/free_form.py"); - output.deleteOnExit(); - } - - @Test(description = "tests ObjectWithValidations") - public void testObjectWithValidations() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7361.yaml"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "FreeFormWithValidation"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); - Assert.assertEquals((int) model.getMinProperties(), 1); - } - - @Test(description = "tests RegexObjects") - public void testRegexObjects() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_11521.yaml"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - codegen.setOpenAPI(openAPI); - - String modelName = "DateTimeObject"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); - final CodegenProperty property1 = model.vars.get(0); - Assert.assertEquals(property1.baseName, "datetime"); - Assert.assertEquals(property1.pattern, "/[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z/"); - Assert.assertEquals(property1.vendorExtensions.get("x-regex"), "[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); - - // ignore warnings, should be the same as in issue_11521.yaml - Pattern pattern = Pattern.compile("[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); - Matcher matcher = pattern.matcher(property1.example); - Assert.assertTrue(matcher.find()); - } - - @Test(description = "tests uuid example works even if a pattern is provided") - public void testUuidExampleWorksEvenIfPatternIsDefined() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issues_13069.yaml"); - final DefaultCodegen codegen = new PythonPriorClientCodegen(); - codegen.setOpenAPI(openAPI); - - Operation operation = openAPI.getPaths().get("/test").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - String modelName = "UUID"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); - - Pattern pattern = Pattern.compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); - Matcher matcher = pattern.matcher(codegenParameter.example); - Assert.assertTrue(matcher.find()); - } - - @Test(description = "tests RecursiveToExample") - public void testRecursiveToExample() throws IOException { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8052_recursive_model.yaml"); - final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); - codegen.setOpenAPI(openAPI); - - final Operation operation = openAPI.getPaths().get("/geojson").getPost(); - Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); - String exampleValue = codegen.toExampleValue(schema, null); - - // uncomment if you need to regenerate the expected value - // PrintWriter printWriter = new PrintWriter("src/test/resources/3_0/issue_8052_recursive_model_expected_value.txt"); - // printWriter.write(exampleValue); - // printWriter.close(); - // org.junit.Assert.assertTrue(false); - - String expectedValue = Resources.toString( - Resources.getResource("3_0/issue_8052_recursive_model_expected_value.txt"), - StandardCharsets.UTF_8); - expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - - - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); - - } - - @Test(description = "tests NoProxyPyClient") - public void testNoProxyPyClient() throws Exception { - - final String gen = "python-prior"; - final String spec = "src/test/resources/3_0/petstore.yaml"; - - File output = Files.createTempDirectory("test").toFile(); - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName(gen) - .setInputSpec(spec) - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - for (String f : new String[] { "openapi_client/configuration.py", "openapi_client/rest.py" } ) { - TestUtils.ensureContainsFile(files, output, f); - Path p = output.toPath().resolve(f); - TestUtils.assertFileContains(p, "no_proxy"); - } - } - - @DataProvider - public Object[][] testToModelData() { - return new Object[][] { - new Object[] {"", "", "foo", "Foo"}, - new Object[] {"Abc", "", "foo", "AbcFoo"}, - new Object[] {"", "Abc", "foo", "FooAbc"}, - new Object[] {"Abc", "Xyz", "foo", "AbcFooXyz"}, - - new Object[] {"", "", "1", "Model1"}, - new Object[] {"Abc", "", "1", "Abc1"}, - new Object[] {"", "Abc", "1", "Model1Abc"}, - new Object[] {"Abc", "Xyz", "1", "Abc1Xyz"}, - - new Object[] {"", "", "and", "ModelAnd"}, - new Object[] {"Abc", "", "and", "AbcAnd"}, - new Object[] {"", "Abc", "and", "AndAbc"}, - new Object[] {"Abc", "Xyz", "and", "AbcAndXyz"}, - }; - } - - @Test(dataProvider = "testToModelData") - public void testToModel(String prefix, String suffix, String input, String want) { - PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); - codegen.setModelNamePrefix(prefix); - codegen.setModelNameSuffix(suffix); - Assert.assertEquals(codegen.toModelName(input), want); - } - - -} diff --git a/pom.xml b/pom.xml index 727254bdc14e..b99238115a02 100644 --- a/pom.xml +++ b/pom.xml @@ -1035,18 +1035,6 @@ samples/client/petstore/typescript-node/npm - - python-client - - - env - java - - - - samples/client/petstore/python-prior - - ruby-client @@ -1175,10 +1163,6 @@ samples/client/petstore/rust/reqwest/petstore-async samples/client/petstore/rust/reqwest/petstore-async-middleware - samples/client/petstore/python-legacy - samples/client/petstore/python-asyncio - samples/client/petstore/python-tornado - samples/openapi3/client/petstore/python-legacy @@ -1222,9 +1206,6 @@ samples/openapi3/client/petstore/python-nextgen samples/openapi3/client/petstore/python-nextgen-aiohttp - samples/client/petstore/python-prior - samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent - samples/openapi3/client/petstore/python - diff --git a/samples/client/petstore/python-asyncio/.gitignore b/samples/client/petstore/python-asyncio/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/client/petstore/python-asyncio/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/client/petstore/python-asyncio/.gitlab-ci.yml b/samples/client/petstore/python-asyncio/.gitlab-ci.yml deleted file mode 100644 index 142ce3712ed0..000000000000 --- a/samples/client/petstore/python-asyncio/.gitlab-ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.nosetest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest - image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest - image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest - image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest - image: python:3.8-alpine diff --git a/samples/client/petstore/python-asyncio/.openapi-generator-ignore b/samples/client/petstore/python-asyncio/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/python-asyncio/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/FILES b/samples/client/petstore/python-asyncio/.openapi-generator/FILES deleted file mode 100644 index 5835827fb98f..000000000000 --- a/samples/client/petstore/python-asyncio/.openapi-generator/FILES +++ /dev/null @@ -1,126 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/models/__init__.py -petstore_api/models/additional_properties_any_type.py -petstore_api/models/additional_properties_array.py -petstore_api/models/additional_properties_boolean.py -petstore_api/models/additional_properties_class.py -petstore_api/models/additional_properties_integer.py -petstore_api/models/additional_properties_number.py -petstore_api/models/additional_properties_object.py -petstore_api/models/additional_properties_string.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/big_cat.py -petstore_api/models/big_cat_all_of.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/format_test.py -petstore_api/models/has_only_read_only.py -petstore_api/models/list.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/number_only.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/pet.py -petstore_api/models/read_only_first.py -petstore_api/models/special_model_name.py -petstore_api/models/tag.py -petstore_api/models/type_holder_default.py -petstore_api/models/type_holder_example.py -petstore_api/models/user.py -petstore_api/models/xml_item.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.travis.yml b/samples/client/petstore/python-asyncio/.travis.yml deleted file mode 100644 index fcd7e31c7ccf..000000000000 --- a/samples/client/petstore/python-asyncio/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python-asyncio/Makefile b/samples/client/petstore/python-asyncio/Makefile deleted file mode 100644 index 8d0afd4974d6..000000000000 --- a/samples/client/petstore/python-asyncio/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test-all: clean - bash ./test_python3.sh diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md deleted file mode 100644 index 5b956c1816dd..000000000000 --- a/samples/client/petstore/python-asyncio/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen - -## Requirements. - -Python 2.7 and 3.4+ - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -from __future__ import print_function - -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -async with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = await api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -## Author - - - - diff --git a/samples/client/petstore/python-asyncio/dev-requirements.txt b/samples/client/petstore/python-asyncio/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/client/petstore/python-asyncio/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index 6d5625857d5e..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesAnyType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 934c43272a94..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesArray - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 577b141d4703..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesBoolean - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 3b789c813670..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_string** | **dict[str, str]** | | [optional] -**map_number** | **dict[str, float]** | | [optional] -**map_integer** | **dict[str, int]** | | [optional] -**map_boolean** | **dict[str, bool]** | | [optional] -**map_array_integer** | **dict[str, list[int]]** | | [optional] -**map_array_anytype** | **dict[str, list[object]]** | | [optional] -**map_map_string** | **dict[str, dict[str, str]]** | | [optional] -**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional] -**anytype_1** | **object** | | [optional] -**anytype_2** | **object** | | [optional] -**anytype_3** | **object** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 4a5e49e0b020..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 39a8992fd4a6..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesNumber - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesObject.md deleted file mode 100644 index ec590e3cf96f..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesString.md deleted file mode 100644 index c7cc62130506..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesString - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Animal.md b/samples/client/petstore/python-asyncio/docs/Animal.md deleted file mode 100644 index 8bc43ab53f33..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md deleted file mode 100644 index 047c4ae6444b..000000000000 --- a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(body) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/ApiResponse.md b/samples/client/petstore/python-asyncio/docs/ApiResponse.md deleted file mode 100644 index 81a7d0d85227..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index b53b6cdb8c46..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **list[list[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 6116bc7489fd..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **list[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/ArrayTest.md b/samples/client/petstore/python-asyncio/docs/ArrayTest.md deleted file mode 100644 index 81420a3b9bbb..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **list[str]** | | [optional] -**array_array_of_integer** | **list[list[int]]** | | [optional] -**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/BigCat.md b/samples/client/petstore/python-asyncio/docs/BigCat.md deleted file mode 100644 index d26809fcff80..000000000000 --- a/samples/client/petstore/python-asyncio/docs/BigCat.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/BigCatAllOf.md b/samples/client/petstore/python-asyncio/docs/BigCatAllOf.md deleted file mode 100644 index c3c42f41da55..000000000000 --- a/samples/client/petstore/python-asyncio/docs/BigCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Capitalization.md b/samples/client/petstore/python-asyncio/docs/Capitalization.md deleted file mode 100644 index 1ddeadeb3f46..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Cat.md b/samples/client/petstore/python-asyncio/docs/Cat.md deleted file mode 100644 index b3eff72b3095..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Cat.md +++ /dev/null @@ -1,11 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/CatAllOf.md b/samples/client/petstore/python-asyncio/docs/CatAllOf.md deleted file mode 100644 index 0ff7809a99ac..000000000000 --- a/samples/client/petstore/python-asyncio/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Category.md b/samples/client/petstore/python-asyncio/docs/Category.md deleted file mode 100644 index 095459c80b65..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/ClassModel.md b/samples/client/petstore/python-asyncio/docs/ClassModel.md deleted file mode 100644 index 48ed7cbf2ff0..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ClassModel.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Client.md b/samples/client/petstore/python-asyncio/docs/Client.md deleted file mode 100644 index c3986008d6c3..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Dog.md b/samples/client/petstore/python-asyncio/docs/Dog.md deleted file mode 100644 index 7eeaf5b68515..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Dog.md +++ /dev/null @@ -1,11 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/DogAllOf.md b/samples/client/petstore/python-asyncio/docs/DogAllOf.md deleted file mode 100644 index 6382bbd80671..000000000000 --- a/samples/client/petstore/python-asyncio/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/EnumArrays.md b/samples/client/petstore/python-asyncio/docs/EnumArrays.md deleted file mode 100644 index 92de0e955650..000000000000 --- a/samples/client/petstore/python-asyncio/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/EnumClass.md b/samples/client/petstore/python-asyncio/docs/EnumClass.md deleted file mode 100644 index 64830e3d1dee..000000000000 --- a/samples/client/petstore/python-asyncio/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/EnumTest.md b/samples/client/petstore/python-asyncio/docs/EnumTest.md deleted file mode 100644 index 1911bfa918cd..000000000000 --- a/samples/client/petstore/python-asyncio/docs/EnumTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **str** | | [optional] -**enum_string_required** | **str** | | -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md deleted file mode 100644 index f91b85f16367..000000000000 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ /dev/null @@ -1,943 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | - - -# **create_xml_item** -> create_xml_item(xml_item) - -creates an XmlItem - -this route creates an XmlItem - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body - - try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) - except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize(body=body) - - - -Test serialization of outer boolean types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(body=body) - - - -Test serialization of object with outer number type - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) - - try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_number_serialize** -> float fake_outer_number_serialize(body=body) - - - -Test serialization of outer number types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 3.4 # float | Input number as post body (optional) - - try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_string_serialize** -> str fake_outer_string_serialize(body=body) - - - -Test serialization of outer string types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) - - try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | - - try: - api_instance.test_body_with_file_schema(body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, body) - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - query = 'query_example' # str | -body = petstore_api.User() # User | - - try: - api_instance.test_body_with_query_params(query, body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(body) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) -int32 = 56 # int | None (optional) -int64 = 56 # int | None (optional) -float = 3.4 # float | None (optional) -string = 'string_example' # str | None (optional) -binary = '/path/to/file' # file | None (optional) -date = '2013-10-20' # date | None (optional) -date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) -password = 'password_example' # str | None (optional) -param_callback = 'param_callback_example' # str | None (optional) - - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - -To test enum parameters - -To test enum parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') -enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') -enum_query_integer = 56 # int | Query parameter enum test (double) (optional) -enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') - - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) -boolean_group = True # bool | Boolean in group parameters (optional) -int64_group = 56 # int | Integer in group parameters (optional) - - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(param) - -test inline additionalProperties - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = {'key': 'param_example'} # dict[str, str] | request body - - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) - except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**dict[str, str]**](str.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pipe = ['pipe_example'] # list[str] | -ioutil = ['ioutil_example'] # list[str] | -http = ['http_example'] # list[str] | -url = ['url_example'] # list[str] | -context = ['context_example'] # list[str] | - - try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) - except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**list[str]**](str.md)| | - **ioutil** | [**list[str]**](str.md)| | - **http** | [**list[str]**](str.md)| | - **url** | [**list[str]**](str.md)| | - **context** | [**list[str]**](str.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 66b43fb1ea11..000000000000 --- a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,82 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(body) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/File.md b/samples/client/petstore/python-asyncio/docs/File.md deleted file mode 100644 index 63b1d1a65186..000000000000 --- a/samples/client/petstore/python-asyncio/docs/File.md +++ /dev/null @@ -1,12 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/FileSchemaTestClass.md b/samples/client/petstore/python-asyncio/docs/FileSchemaTestClass.md deleted file mode 100644 index 58d71b7a26be..000000000000 --- a/samples/client/petstore/python-asyncio/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**list[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/FormatTest.md b/samples/client/petstore/python-asyncio/docs/FormatTest.md deleted file mode 100644 index 239b60134ab5..000000000000 --- a/samples/client/petstore/python-asyncio/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **float** | | -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**byte** | **str** | | -**binary** | **file** | | [optional] -**date** | **date** | | -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**password** | **str** | | -**big_decimal** | [**Decimal**](Decimal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md deleted file mode 100644 index 0e1334519a8b..000000000000 --- a/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/List.md b/samples/client/petstore/python-asyncio/docs/List.md deleted file mode 100644 index 4b60956971aa..000000000000 --- a/samples/client/petstore/python-asyncio/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/MapTest.md b/samples/client/petstore/python-asyncio/docs/MapTest.md deleted file mode 100644 index 8f136137b524..000000000000 --- a/samples/client/petstore/python-asyncio/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional] -**map_of_enum_string** | **dict[str, str]** | | [optional] -**direct_map** | **dict[str, bool]** | | [optional] -**indirect_map** | **dict[str, bool]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 46fb6992509c..000000000000 --- a/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**dict[str, Animal]**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Model200Response.md b/samples/client/petstore/python-asyncio/docs/Model200Response.md deleted file mode 100644 index c958bd4b33f8..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Model200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/ModelReturn.md b/samples/client/petstore/python-asyncio/docs/ModelReturn.md deleted file mode 100644 index 043e9d466fab..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ModelReturn.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Model_200Response.md b/samples/client/petstore/python-asyncio/docs/Model_200Response.md deleted file mode 100644 index 4fd119d12515..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Model_200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Model_Return.md b/samples/client/petstore/python-asyncio/docs/Model_Return.md deleted file mode 100644 index 674c441551b3..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Model_Return.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Name.md b/samples/client/petstore/python-asyncio/docs/Name.md deleted file mode 100644 index 3be719cdbfba..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Name.md +++ /dev/null @@ -1,15 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/NumberOnly.md b/samples/client/petstore/python-asyncio/docs/NumberOnly.md deleted file mode 100644 index 37195c5d8994..000000000000 --- a/samples/client/petstore/python-asyncio/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Order.md b/samples/client/petstore/python-asyncio/docs/Order.md deleted file mode 100644 index f360fffe8149..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to False] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/OuterComposite.md b/samples/client/petstore/python-asyncio/docs/OuterComposite.md deleted file mode 100644 index 31013673df73..000000000000 --- a/samples/client/petstore/python-asyncio/docs/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# OuterComposite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/OuterEnum.md b/samples/client/petstore/python-asyncio/docs/OuterEnum.md deleted file mode 100644 index 4cb31437c7e2..000000000000 --- a/samples/client/petstore/python-asyncio/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/Pet.md b/samples/client/petstore/python-asyncio/docs/Pet.md deleted file mode 100644 index c462e794c89a..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **str** | | -**photo_urls** | **list[str]** | | -**tags** | [**list[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md deleted file mode 100644 index e8176632d088..000000000000 --- a/samples/client/petstore/python-asyncio/docs/PetApi.md +++ /dev/null @@ -1,681 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(body) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Add a new pet to the store - api_instance.add_pet(body) - except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id, api_key=api_key) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) - - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> list[Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - status = ['status_example'] # list[str] | Status values that need to be considered for filter - - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> list[Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - tags = ['tags_example'] # list[str] | Tags to filter by - - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**list[str]**](str.md)| Tags to filter by | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to return - - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(body) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Update an existing pet - api_instance.update_pet(body) - except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id, name=name, status=status) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) -status = 'status_example' # str | Updated status of the pet (optional) - - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -file = '/path/to/file' # file | file to upload (optional) - - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -required_file = '/path/to/file' # file | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md b/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md deleted file mode 100644 index 53b4c61d8445..000000000000 --- a/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/SpecialModelName.md b/samples/client/petstore/python-asyncio/docs/SpecialModelName.md deleted file mode 100644 index 268e1134192d..000000000000 --- a/samples/client/petstore/python-asyncio/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md deleted file mode 100644 index 832ed33acca8..000000000000 --- a/samples/client/petstore/python-asyncio/docs/StoreApi.md +++ /dev/null @@ -1,268 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 'order_id_example' # str | ID of the order that needs to be deleted - - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> dict[str, int] get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**dict[str, int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 56 # int | ID of pet that needs to be fetched - - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(body) - -Place an order for a pet - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - body = petstore_api.Order() # Order | order placed for purchasing the pet - - try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/Tag.md b/samples/client/petstore/python-asyncio/docs/Tag.md deleted file mode 100644 index 4ccac4949afc..000000000000 --- a/samples/client/petstore/python-asyncio/docs/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md b/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md deleted file mode 100644 index 13d283006304..000000000000 --- a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# TypeHolderDefault - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | [default to True] -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md b/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md deleted file mode 100644 index f75bdd36f647..000000000000 --- a/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeHolderExample - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | -**number_item** | **float** | | -**float_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/User.md b/samples/client/petstore/python-asyncio/docs/User.md deleted file mode 100644 index b0079f591b6e..000000000000 --- a/samples/client/petstore/python-asyncio/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md deleted file mode 100644 index 6cb9d1ec3849..000000000000 --- a/samples/client/petstore/python-asyncio/docs/UserApi.md +++ /dev/null @@ -1,501 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(body) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = petstore_api.User() # User | Created user object - - try: - # Create user - api_instance.create_user(body) - except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be deleted - - try: - # Delete user - api_instance.delete_user(username) - except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - - try: - # Logs out current logged in user session - api_instance.logout_user() - except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | name that need to be deleted -body = petstore_api.User() # User | Updated user object - - try: - # Updated user - api_instance.update_user(username, body) - except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-asyncio/docs/XmlItem.md b/samples/client/petstore/python-asyncio/docs/XmlItem.md deleted file mode 100644 index acaadbdb5f78..000000000000 --- a/samples/client/petstore/python-asyncio/docs/XmlItem.md +++ /dev/null @@ -1,39 +0,0 @@ -# XmlItem - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **str** | | [optional] -**attribute_number** | **float** | | [optional] -**attribute_integer** | **int** | | [optional] -**attribute_boolean** | **bool** | | [optional] -**wrapped_array** | **list[int]** | | [optional] -**name_string** | **str** | | [optional] -**name_number** | **float** | | [optional] -**name_integer** | **int** | | [optional] -**name_boolean** | **bool** | | [optional] -**name_array** | **list[int]** | | [optional] -**name_wrapped_array** | **list[int]** | | [optional] -**prefix_string** | **str** | | [optional] -**prefix_number** | **float** | | [optional] -**prefix_integer** | **int** | | [optional] -**prefix_boolean** | **bool** | | [optional] -**prefix_array** | **list[int]** | | [optional] -**prefix_wrapped_array** | **list[int]** | | [optional] -**namespace_string** | **str** | | [optional] -**namespace_number** | **float** | | [optional] -**namespace_integer** | **int** | | [optional] -**namespace_boolean** | **bool** | | [optional] -**namespace_array** | **list[int]** | | [optional] -**namespace_wrapped_array** | **list[int]** | | [optional] -**prefix_ns_string** | **str** | | [optional] -**prefix_ns_number** | **float** | | [optional] -**prefix_ns_integer** | **int** | | [optional] -**prefix_ns_boolean** | **bool** | | [optional] -**prefix_ns_array** | **list[int]** | | [optional] -**prefix_ns_wrapped_array** | **list[int]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-asyncio/git_push.sh b/samples/client/petstore/python-asyncio/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/python-asyncio/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/python-asyncio/petstore_api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/__init__.py deleted file mode 100644 index 62a0d6bb97f5..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/__init__.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - -# import ApiClient -from petstore_api.api_client import ApiClient -from petstore_api.configuration import Configuration -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiException -# import models into sdk package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem - diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py deleted file mode 100644 index ea4a9e3acb7d..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py deleted file mode 100644 index 8719c9511f17..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def call_123_test_special_tags(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 - - def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method call_123_test_special_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py deleted file mode 100644 index 7eae03dd24ec..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2230 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_xml_item(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 - - def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'xml_item' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_xml_item" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'xml_item' in local_var_params: - body_params = local_var_params['xml_item'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/create_xml_item', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bool - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_boolean_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "bool", - } - - return self.api_client.call_api( - '/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: OuterComposite - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_composite_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "OuterComposite", - } - - return self.api_client.call_api( - '/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: float - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_number_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "float", - } - - return self.api_client.call_api( - '/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_string_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - } - - return self.api_client.call_api( - '/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_file_schema(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 - - def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_file_schema" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-file-schema', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 - - def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'query', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_query_params" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query' is set - if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query') is not None: # noqa: E501 - query_params.append(('query', local_var_params['query'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-query-params', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 - - def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_client_model" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'number' is set - if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'double' is set - if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 - raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 - raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) > 64): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) < 10): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'integer' in local_var_params: - form_params.append(('integer', local_var_params['integer'])) # noqa: E501 - if 'int32' in local_var_params: - form_params.append(('int32', local_var_params['int32'])) # noqa: E501 - if 'int64' in local_var_params: - form_params.append(('int64', local_var_params['int64'])) # noqa: E501 - if 'number' in local_var_params: - form_params.append(('number', local_var_params['number'])) # noqa: E501 - if 'float' in local_var_params: - form_params.append(('float', local_var_params['float'])) # noqa: E501 - if 'double' in local_var_params: - form_params.append(('double', local_var_params['double'])) # noqa: E501 - if 'string' in local_var_params: - form_params.append(('string', local_var_params['string'])) # noqa: E501 - if 'pattern_without_delimiter' in local_var_params: - form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 - if 'byte' in local_var_params: - form_params.append(('byte', local_var_params['byte'])) # noqa: E501 - if 'binary' in local_var_params: - local_var_files['binary'] = local_var_params['binary'] # noqa: E501 - if 'date' in local_var_params: - form_params.append(('date', local_var_params['date'])) # noqa: E501 - if 'date_time' in local_var_params: - form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 - if 'password' in local_var_params: - form_params.append(('password', local_var_params['password'])) # noqa: E501 - if 'param_callback' in local_var_params: - form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_basic_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - - def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters_with_http_info(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_enum_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 - query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 - collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if local_var_params.get('enum_query_string') is not None: # noqa: E501 - query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if local_var_params.get('enum_query_integer') is not None: # noqa: E501 - query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if local_var_params.get('enum_query_double') is not None: # noqa: E501 - query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'enum_header_string_array' in local_var_params: - header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 - collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 - if 'enum_header_string' in local_var_params: - header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 - - form_params = [] - local_var_files = {} - if 'enum_form_string_array' in local_var_params: - form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 - collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 - if 'enum_form_string' in local_var_params: - form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - - def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_group_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('required_string_group') is not None: # noqa: E501 - query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if local_var_params.get('required_int64_group') is not None: # noqa: E501 - query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if local_var_params.get('string_group') is not None: # noqa: E501 - query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if local_var_params.get('int64_group') is not None: # noqa: E501 - query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'required_boolean_group' in local_var_params: - header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 - if 'boolean_group' in local_var_params: - header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 - - def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_inline_additional_properties" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'param' in local_var_params: - body_params = local_var_params['param'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - - def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param', - 'param2' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_json_form_data" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 - # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'param' in local_var_params: - form_params.append(('param', local_var_params['param'])) # noqa: E501 - if 'param2' in local_var_params: - form_params.append(('param2', local_var_params['param2'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 - - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_query_parameter_collection_format" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'http' is set - if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'url' is set - if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'context' is set - if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('pipe') is not None: # noqa: E501 - query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 - collection_formats['pipe'] = 'csv' # noqa: E501 - if local_var_params.get('ioutil') is not None: # noqa: E501 - query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 - collection_formats['ioutil'] = 'csv' # noqa: E501 - if local_var_params.get('http') is not None: # noqa: E501 - query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 - if local_var_params.get('url') is not None: # noqa: E501 - query_params.append(('url', local_var_params['url'])) # noqa: E501 - collection_formats['url'] = 'csv' # noqa: E501 - if local_var_params.get('context') is not None: # noqa: E501 - query_params.append(('context', local_var_params['context'])) # noqa: E501 - collection_formats['context'] = 'multi' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/test-query-parameters', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index 7dd05dd2d3dc..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index b5cd8cd22c94..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py deleted file mode 100644 index b2cf9e3641cd..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1332 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_pet(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 - - def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - - def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'api_key' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - if 'api_key' in local_var_params: - header_params['api_key'] = local_var_params['api_key'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - - def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_status" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('status') is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 - collection_formats['status'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - - def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'tags' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('tags') is not None: # noqa: E501 - query_params.append(('tags', local_var_params['tags'])) # noqa: E501 - collection_formats['tags'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Pet - """ - kwargs['_return_http_data_only'] = True - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "Pet", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 - - def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'name', - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet_with_form" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'name' in local_var_params: - form_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'status' in local_var_params: - form_params.append(('status', local_var_params['status'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 - - def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'additional_metadata', - 'file' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - - def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'required_file', - 'additional_metadata' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file_with_required_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 - # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'required_file' in local_var_params: - local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/fake/{petId}/uploadImageWithRequiredFile', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py deleted file mode 100644 index 17b8b851cfce..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py +++ /dev/null @@ -1,574 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - - def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: dict[str, int] - """ - kwargs['_return_http_data_only'] = True - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 - - def get_inventory_with_http_info(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_inventory" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "dict[str, int]", - } - - return self.api_client.call_api( - '/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - - def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_order_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def place_order(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.place_order_with_http_info(body, **kwargs) # noqa: E501 - - def place_order_with_http_info(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - } - - return self.api_client.call_api( - '/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py deleted file mode 100644 index 29e66939d737..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py +++ /dev/null @@ -1,1100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_user(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_user_with_http_info(body, **kwargs) # noqa: E501 - - def create_user_with_http_info(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_array_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_array_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_list_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_list_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - - def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - - def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "User", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - - def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user_with_http_info(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'password' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 - # verify the required parameter 'password' is set - if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('username') is not None: # noqa: E501 - query_params.append(('username', local_var_params['username'])) # noqa: E501 - if local_var_params.get('password') is not None: # noqa: E501 - query_params.append(('password', local_var_params['password'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - 400: None, - } - - return self.api_client.call_api( - '/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.logout_user_with_http_info(**kwargs) # noqa: E501 - - def logout_user_with_http_info(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_user(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 - - def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_with_http_info(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py deleted file mode 100644 index 2b87dbade1d1..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ /dev/null @@ -1,702 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote - -from petstore_api.configuration import Configuration -import petstore_api.models -from petstore_api import rest -from petstore_api.exceptions import ApiValueError, ApiException - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_value, traceback): - await self.close() - - async def close(self): - await self.rest_client.close() - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - async def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = await self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return return_data - - response_type = response_types_map.get(response_data.status, None) - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict['): - sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(petstore_api.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, queries, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) - - def _apply_auth_params(self, headers, queries, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - kwargs["local_vars_configuration"] = self.configuration - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py deleted file mode 100644 index bfe7a5e68509..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ /dev/null @@ -1,518 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import sys -import urllib3 - -import six -from six.moves import http_client as httplib -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.access_token = None - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = 100 - """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://petstore.swagger.io:80/v2", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/client/petstore/python-asyncio/petstore_api/exceptions.py b/samples/client/petstore/python-asyncio/petstore_api/exceptions.py deleted file mode 100644 index 08181d4775db..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/exceptions.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py deleted file mode 100644 index ddef3dea4fdb..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_any_type.py deleted file mode 100644 index 01457faa3a33..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_any_type.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesAnyType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesAnyType. # noqa: E501 - - - :return: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesAnyType. - - - :param name: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_array.py deleted file mode 100644 index c7283e161360..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_array.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesArray(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesArray. # noqa: E501 - - - :return: The name of this AdditionalPropertiesArray. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesArray. - - - :param name: The name of this AdditionalPropertiesArray. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesArray): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesArray): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_boolean.py deleted file mode 100644 index 3a8ec8f66aac..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_boolean.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesBoolean(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesBoolean. # noqa: E501 - - - :return: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesBoolean. - - - :param name: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py deleted file mode 100644 index b561f467d21e..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py +++ /dev/null @@ -1,391 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_string': 'dict[str, str]', - 'map_number': 'dict[str, float]', - 'map_integer': 'dict[str, int]', - 'map_boolean': 'dict[str, bool]', - 'map_array_integer': 'dict[str, list[int]]', - 'map_array_anytype': 'dict[str, list[object]]', - 'map_map_string': 'dict[str, dict[str, str]]', - 'map_map_anytype': 'dict[str, dict[str, object]]', - 'anytype_1': 'object', - 'anytype_2': 'object', - 'anytype_3': 'object' - } - - attribute_map = { - 'map_string': 'map_string', - 'map_number': 'map_number', - 'map_integer': 'map_integer', - 'map_boolean': 'map_boolean', - 'map_array_integer': 'map_array_integer', - 'map_array_anytype': 'map_array_anytype', - 'map_map_string': 'map_map_string', - 'map_map_anytype': 'map_map_anytype', - 'anytype_1': 'anytype_1', - 'anytype_2': 'anytype_2', - 'anytype_3': 'anytype_3' - } - - def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_string = None - self._map_number = None - self._map_integer = None - self._map_boolean = None - self._map_array_integer = None - self._map_array_anytype = None - self._map_map_string = None - self._map_map_anytype = None - self._anytype_1 = None - self._anytype_2 = None - self._anytype_3 = None - self.discriminator = None - - if map_string is not None: - self.map_string = map_string - if map_number is not None: - self.map_number = map_number - if map_integer is not None: - self.map_integer = map_integer - if map_boolean is not None: - self.map_boolean = map_boolean - if map_array_integer is not None: - self.map_array_integer = map_array_integer - if map_array_anytype is not None: - self.map_array_anytype = map_array_anytype - if map_map_string is not None: - self.map_map_string = map_map_string - if map_map_anytype is not None: - self.map_map_anytype = map_map_anytype - if anytype_1 is not None: - self.anytype_1 = anytype_1 - if anytype_2 is not None: - self.anytype_2 = anytype_2 - if anytype_3 is not None: - self.anytype_3 = anytype_3 - - @property - def map_string(self): - """Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_string - - @map_string.setter - def map_string(self, map_string): - """Sets the map_string of this AdditionalPropertiesClass. - - - :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_string: dict[str, str] - """ - - self._map_string = map_string - - @property - def map_number(self): - """Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, float] - """ - return self._map_number - - @map_number.setter - def map_number(self, map_number): - """Sets the map_number of this AdditionalPropertiesClass. - - - :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :type map_number: dict[str, float] - """ - - self._map_number = map_number - - @property - def map_integer(self): - """Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, int] - """ - return self._map_integer - - @map_integer.setter - def map_integer(self, map_integer): - """Sets the map_integer of this AdditionalPropertiesClass. - - - :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_integer: dict[str, int] - """ - - self._map_integer = map_integer - - @property - def map_boolean(self): - """Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._map_boolean - - @map_boolean.setter - def map_boolean(self, map_boolean): - """Sets the map_boolean of this AdditionalPropertiesClass. - - - :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :type map_boolean: dict[str, bool] - """ - - self._map_boolean = map_boolean - - @property - def map_array_integer(self): - """Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[int]] - """ - return self._map_array_integer - - @map_array_integer.setter - def map_array_integer(self, map_array_integer): - """Sets the map_array_integer of this AdditionalPropertiesClass. - - - :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_integer: dict[str, list[int]] - """ - - self._map_array_integer = map_array_integer - - @property - def map_array_anytype(self): - """Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[object]] - """ - return self._map_array_anytype - - @map_array_anytype.setter - def map_array_anytype(self, map_array_anytype): - """Sets the map_array_anytype of this AdditionalPropertiesClass. - - - :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_anytype: dict[str, list[object]] - """ - - self._map_array_anytype = map_array_anytype - - @property - def map_map_string(self): - """Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_string - - @map_map_string.setter - def map_map_string(self, map_map_string): - """Sets the map_map_string of this AdditionalPropertiesClass. - - - :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_string: dict[str, dict[str, str]] - """ - - self._map_map_string = map_map_string - - @property - def map_map_anytype(self): - """Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, object]] - """ - return self._map_map_anytype - - @map_map_anytype.setter - def map_map_anytype(self, map_map_anytype): - """Sets the map_map_anytype of this AdditionalPropertiesClass. - - - :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_anytype: dict[str, dict[str, object]] - """ - - self._map_map_anytype = map_map_anytype - - @property - def anytype_1(self): - """Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_1 - - @anytype_1.setter - def anytype_1(self, anytype_1): - """Sets the anytype_1 of this AdditionalPropertiesClass. - - - :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_1: object - """ - - self._anytype_1 = anytype_1 - - @property - def anytype_2(self): - """Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_2 - - @anytype_2.setter - def anytype_2(self, anytype_2): - """Sets the anytype_2 of this AdditionalPropertiesClass. - - - :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_2: object - """ - - self._anytype_2 = anytype_2 - - @property - def anytype_3(self): - """Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_3 - - @anytype_3.setter - def anytype_3(self, anytype_3): - """Sets the anytype_3 of this AdditionalPropertiesClass. - - - :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_3: object - """ - - self._anytype_3 = anytype_3 - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_integer.py deleted file mode 100644 index d9ee889d7a33..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_integer.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesInteger(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesInteger. # noqa: E501 - - - :return: The name of this AdditionalPropertiesInteger. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesInteger. - - - :param name: The name of this AdditionalPropertiesInteger. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_number.py deleted file mode 100644 index 756fc037970f..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_number.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesNumber(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesNumber. # noqa: E501 - - - :return: The name of this AdditionalPropertiesNumber. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesNumber. - - - :param name: The name of this AdditionalPropertiesNumber. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_object.py deleted file mode 100644 index bfbe2db1bef9..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_object.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesObject. # noqa: E501 - - - :return: The name of this AdditionalPropertiesObject. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesObject. - - - :param name: The name of this AdditionalPropertiesObject. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesObject): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesObject): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_string.py deleted file mode 100644 index 7c33a16fe8fc..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_string.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesString(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesString. # noqa: E501 - - - :return: The name of this AdditionalPropertiesString. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesString. - - - :param name: The name of this AdditionalPropertiesString. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesString): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesString): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py deleted file mode 100644 index 335eb2625af4..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Animal(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'class_name': 'str', - 'color': 'str' - } - - attribute_map = { - 'class_name': 'className', - 'color': 'color' - } - - discriminator_value_class_map = { - 'BigCat': 'BigCat', - 'Cat': 'Cat', - 'Dog': 'Dog' - } - - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 - """Animal - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._class_name = None - self._color = None - self.discriminator = 'class_name' - - self.class_name = class_name - if color is not None: - self.color = color - - @property - def class_name(self): - """Gets the class_name of this Animal. # noqa: E501 - - - :return: The class_name of this Animal. # noqa: E501 - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """Sets the class_name of this Animal. - - - :param class_name: The class_name of this Animal. # noqa: E501 - :type class_name: str - """ - if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 - raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 - - self._class_name = class_name - - @property - def color(self): - """Gets the color of this Animal. # noqa: E501 - - - :return: The color of this Animal. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this Animal. - - - :param color: The color of this Animal. # noqa: E501 - :type color: str - """ - - self._color = color - - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Animal): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Animal): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py deleted file mode 100644 index bddac1eb10a3..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ApiResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str' - } - - attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } - - def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._type = None - self._message = None - self.discriminator = None - - if code is not None: - self.code = code - if type is not None: - self.type = type - if message is not None: - self.message = message - - @property - def code(self): - """Gets the code of this ApiResponse. # noqa: E501 - - - :return: The code of this ApiResponse. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this ApiResponse. - - - :param code: The code of this ApiResponse. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def type(self): - """Gets the type of this ApiResponse. # noqa: E501 - - - :return: The type of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this ApiResponse. - - - :param type: The type of this ApiResponse. # noqa: E501 - :type type: str - """ - - self._type = type - - @property - def message(self): - """Gets the message of this ApiResponse. # noqa: E501 - - - :return: The message of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this ApiResponse. - - - :param message: The message of this ApiResponse. # noqa: E501 - :type message: str - """ - - self._message = message - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ApiResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ApiResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py deleted file mode 100644 index 2975adc20e31..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_array_number': 'list[list[float]]' - } - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber' - } - - def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_array_number = None - self.discriminator = None - - if array_array_number is not None: - self.array_array_number = array_array_number - - @property - def array_array_number(self): - """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - - - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :rtype: list[list[float]] - """ - return self._array_array_number - - @array_array_number.setter - def array_array_number(self, array_array_number): - """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. - - - :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :type array_array_number: list[list[float]] - """ - - self._array_array_number = array_array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py deleted file mode 100644 index 2a3400e76660..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_number': 'list[float]' - } - - attribute_map = { - 'array_number': 'ArrayNumber' - } - - def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_number = None - self.discriminator = None - - if array_number is not None: - self.array_number = array_number - - @property - def array_number(self): - """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - - - :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :rtype: list[float] - """ - return self._array_number - - @array_number.setter - def array_number(self, array_number): - """Sets the array_number of this ArrayOfNumberOnly. - - - :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :type array_number: list[float] - """ - - self._array_number = array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py deleted file mode 100644 index 11394dcb7bc1..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' - } - - attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' - } - - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_of_string = None - self._array_array_of_integer = None - self._array_array_of_model = None - self.discriminator = None - - if array_of_string is not None: - self.array_of_string = array_of_string - if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer - if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model - - @property - def array_of_string(self): - """Gets the array_of_string of this ArrayTest. # noqa: E501 - - - :return: The array_of_string of this ArrayTest. # noqa: E501 - :rtype: list[str] - """ - return self._array_of_string - - @array_of_string.setter - def array_of_string(self, array_of_string): - """Sets the array_of_string of this ArrayTest. - - - :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 - :type array_of_string: list[str] - """ - - self._array_of_string = array_of_string - - @property - def array_array_of_integer(self): - """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_integer of this ArrayTest. # noqa: E501 - :rtype: list[list[int]] - """ - return self._array_array_of_integer - - @array_array_of_integer.setter - def array_array_of_integer(self, array_array_of_integer): - """Sets the array_array_of_integer of this ArrayTest. - - - :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 - :type array_array_of_integer: list[list[int]] - """ - - self._array_array_of_integer = array_array_of_integer - - @property - def array_array_of_model(self): - """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_model of this ArrayTest. # noqa: E501 - :rtype: list[list[ReadOnlyFirst]] - """ - return self._array_array_of_model - - @array_array_of_model.setter - def array_array_of_model(self, array_array_of_model): - """Sets the array_array_of_model of this ArrayTest. - - - :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 - :type array_array_of_model: list[list[ReadOnlyFirst]] - """ - - self._array_array_of_model = array_array_of_model - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/big_cat.py b/samples/client/petstore/python-asyncio/petstore_api/models/big_cat.py deleted file mode 100644 index 9a108ce3717e..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/big_cat.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCat. # noqa: E501 - - - :return: The kind of this BigCat. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCat. - - - :param kind: The kind of this BigCat. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/big_cat_all_of.py b/samples/client/petstore/python-asyncio/petstore_api/models/big_cat_all_of.py deleted file mode 100644 index 6d6c9aeb5c0c..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/big_cat_all_of.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCatAllOf. # noqa: E501 - - - :return: The kind of this BigCatAllOf. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCatAllOf. - - - :param kind: The kind of this BigCatAllOf. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py deleted file mode 100644 index cb8b0d985842..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Capitalization(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str' - } - - attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' - } - - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._small_camel = None - self._capital_camel = None - self._small_snake = None - self._capital_snake = None - self._sca_eth_flow_points = None - self._att_name = None - self.discriminator = None - - if small_camel is not None: - self.small_camel = small_camel - if capital_camel is not None: - self.capital_camel = capital_camel - if small_snake is not None: - self.small_snake = small_snake - if capital_snake is not None: - self.capital_snake = capital_snake - if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points - if att_name is not None: - self.att_name = att_name - - @property - def small_camel(self): - """Gets the small_camel of this Capitalization. # noqa: E501 - - - :return: The small_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_camel - - @small_camel.setter - def small_camel(self, small_camel): - """Sets the small_camel of this Capitalization. - - - :param small_camel: The small_camel of this Capitalization. # noqa: E501 - :type small_camel: str - """ - - self._small_camel = small_camel - - @property - def capital_camel(self): - """Gets the capital_camel of this Capitalization. # noqa: E501 - - - :return: The capital_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_camel - - @capital_camel.setter - def capital_camel(self, capital_camel): - """Sets the capital_camel of this Capitalization. - - - :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 - :type capital_camel: str - """ - - self._capital_camel = capital_camel - - @property - def small_snake(self): - """Gets the small_snake of this Capitalization. # noqa: E501 - - - :return: The small_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_snake - - @small_snake.setter - def small_snake(self, small_snake): - """Sets the small_snake of this Capitalization. - - - :param small_snake: The small_snake of this Capitalization. # noqa: E501 - :type small_snake: str - """ - - self._small_snake = small_snake - - @property - def capital_snake(self): - """Gets the capital_snake of this Capitalization. # noqa: E501 - - - :return: The capital_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_snake - - @capital_snake.setter - def capital_snake(self, capital_snake): - """Sets the capital_snake of this Capitalization. - - - :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 - :type capital_snake: str - """ - - self._capital_snake = capital_snake - - @property - def sca_eth_flow_points(self): - """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - - - :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._sca_eth_flow_points - - @sca_eth_flow_points.setter - def sca_eth_flow_points(self, sca_eth_flow_points): - """Sets the sca_eth_flow_points of this Capitalization. - - - :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :type sca_eth_flow_points: str - """ - - self._sca_eth_flow_points = sca_eth_flow_points - - @property - def att_name(self): - """Gets the att_name of this Capitalization. # noqa: E501 - - Name of the pet # noqa: E501 - - :return: The att_name of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._att_name - - @att_name.setter - def att_name(self, att_name): - """Sets the att_name of this Capitalization. - - Name of the pet # noqa: E501 - - :param att_name: The att_name of this Capitalization. # noqa: E501 - :type att_name: str - """ - - self._att_name = att_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Capitalization): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Capitalization): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py deleted file mode 100644 index 0d9a0b20bf1a..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Cat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """Cat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this Cat. # noqa: E501 - - - :return: The declawed of this Cat. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this Cat. - - - :param declawed: The declawed of this Cat. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Cat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Cat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-asyncio/petstore_api/models/cat_all_of.py deleted file mode 100644 index 0633bbf58d0d..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/cat_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class CatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this CatAllOf. # noqa: E501 - - - :return: The declawed of this CatAllOf. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this CatAllOf. - - - :param declawed: The declawed of this CatAllOf. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py deleted file mode 100644 index ef52dcbf8c91..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/category.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Category(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 - """Category - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - - @property - def id(self): - """Gets the id of this Category. # noqa: E501 - - - :return: The id of this Category. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Category. - - - :param id: The id of this Category. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Category. # noqa: E501 - - - :return: The name of this Category. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Category. - - - :param name: The name of this Category. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Category): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Category): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py deleted file mode 100644 index 84c0de65b472..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ClassModel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_class': 'str' - } - - attribute_map = { - '_class': '_class' - } - - def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__class = None - self.discriminator = None - - if _class is not None: - self._class = _class - - @property - def _class(self): - """Gets the _class of this ClassModel. # noqa: E501 - - - :return: The _class of this ClassModel. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this ClassModel. - - - :param _class: The _class of this ClassModel. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ClassModel): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ClassModel): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/client.py b/samples/client/petstore/python-asyncio/petstore_api/models/client.py deleted file mode 100644 index 8d7c83ecfe6b..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/client.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Client(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'client': 'str' - } - - attribute_map = { - 'client': 'client' - } - - def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 - """Client - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._client = None - self.discriminator = None - - if client is not None: - self.client = client - - @property - def client(self): - """Gets the client of this Client. # noqa: E501 - - - :return: The client of this Client. # noqa: E501 - :rtype: str - """ - return self._client - - @client.setter - def client(self, client): - """Sets the client of this Client. - - - :param client: The client of this Client. # noqa: E501 - :type client: str - """ - - self._client = client - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Client): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Client): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py deleted file mode 100644 index 61acd35cdfe2..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Dog(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """Dog - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this Dog. # noqa: E501 - - - :return: The breed of this Dog. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this Dog. - - - :param breed: The breed of this Dog. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dog): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Dog): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-asyncio/petstore_api/models/dog_all_of.py deleted file mode 100644 index 3a052c3258ae..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/dog_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class DogAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this DogAllOf. # noqa: E501 - - - :return: The breed of this DogAllOf. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this DogAllOf. - - - :param breed: The breed of this DogAllOf. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DogAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DogAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py deleted file mode 100644 index eb4f3ea4ca32..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumArrays(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]' - } - - attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' - } - - def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_symbol = None - self._array_enum = None - self.discriminator = None - - if just_symbol is not None: - self.just_symbol = just_symbol - if array_enum is not None: - self.array_enum = array_enum - - @property - def just_symbol(self): - """Gets the just_symbol of this EnumArrays. # noqa: E501 - - - :return: The just_symbol of this EnumArrays. # noqa: E501 - :rtype: str - """ - return self._just_symbol - - @just_symbol.setter - def just_symbol(self, just_symbol): - """Sets the just_symbol of this EnumArrays. - - - :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 - :type just_symbol: str - """ - allowed_values = [">=", "$"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 - .format(just_symbol, allowed_values) - ) - - self._just_symbol = just_symbol - - @property - def array_enum(self): - """Gets the array_enum of this EnumArrays. # noqa: E501 - - - :return: The array_enum of this EnumArrays. # noqa: E501 - :rtype: list[str] - """ - return self._array_enum - - @array_enum.setter - def array_enum(self, array_enum): - """Sets the array_enum of this EnumArrays. - - - :param array_enum: The array_enum of this EnumArrays. # noqa: E501 - :type array_enum: list[str] - """ - allowed_values = ["fish", "crab"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(array_enum).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._array_enum = array_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumArrays): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumArrays): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py deleted file mode 100644 index 79aac3570cb9..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _ABC = "_abc" - _EFG = "-efg" - _XYZ_ = "(xyz)" - - allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """EnumClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py deleted file mode 100644 index 1f3d7cb29b89..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py +++ /dev/null @@ -1,260 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'enum_string': 'str', - 'enum_string_required': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum' - } - - attribute_map = { - 'enum_string': 'enum_string', - 'enum_string_required': 'enum_string_required', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum' - } - - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._enum_string = None - self._enum_string_required = None - self._enum_integer = None - self._enum_number = None - self._outer_enum = None - self.discriminator = None - - if enum_string is not None: - self.enum_string = enum_string - self.enum_string_required = enum_string_required - if enum_integer is not None: - self.enum_integer = enum_integer - if enum_number is not None: - self.enum_number = enum_number - if outer_enum is not None: - self.outer_enum = outer_enum - - @property - def enum_string(self): - """Gets the enum_string of this EnumTest. # noqa: E501 - - - :return: The enum_string of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string - - @enum_string.setter - def enum_string(self, enum_string): - """Sets the enum_string of this EnumTest. - - - :param enum_string: The enum_string of this EnumTest. # noqa: E501 - :type enum_string: str - """ - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string, allowed_values) - ) - - self._enum_string = enum_string - - @property - def enum_string_required(self): - """Gets the enum_string_required of this EnumTest. # noqa: E501 - - - :return: The enum_string_required of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string_required - - @enum_string_required.setter - def enum_string_required(self, enum_string_required): - """Sets the enum_string_required of this EnumTest. - - - :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 - :type enum_string_required: str - """ - if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 - raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string_required, allowed_values) - ) - - self._enum_string_required = enum_string_required - - @property - def enum_integer(self): - """Gets the enum_integer of this EnumTest. # noqa: E501 - - - :return: The enum_integer of this EnumTest. # noqa: E501 - :rtype: int - """ - return self._enum_integer - - @enum_integer.setter - def enum_integer(self, enum_integer): - """Sets the enum_integer of this EnumTest. - - - :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 - :type enum_integer: int - """ - allowed_values = [1, -1] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 - .format(enum_integer, allowed_values) - ) - - self._enum_integer = enum_integer - - @property - def enum_number(self): - """Gets the enum_number of this EnumTest. # noqa: E501 - - - :return: The enum_number of this EnumTest. # noqa: E501 - :rtype: float - """ - return self._enum_number - - @enum_number.setter - def enum_number(self, enum_number): - """Sets the enum_number of this EnumTest. - - - :param enum_number: The enum_number of this EnumTest. # noqa: E501 - :type enum_number: float - """ - allowed_values = [1.1, -1.2] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 - .format(enum_number, allowed_values) - ) - - self._enum_number = enum_number - - @property - def outer_enum(self): - """Gets the outer_enum of this EnumTest. # noqa: E501 - - - :return: The outer_enum of this EnumTest. # noqa: E501 - :rtype: OuterEnum - """ - return self._outer_enum - - @outer_enum.setter - def outer_enum(self, outer_enum): - """Sets the outer_enum of this EnumTest. - - - :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 - :type outer_enum: OuterEnum - """ - - self._outer_enum = outer_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/file.py b/samples/client/petstore/python-asyncio/petstore_api/models/file.py deleted file mode 100644 index 2c1cccac0e11..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/file.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class File(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'source_uri': 'str' - } - - attribute_map = { - 'source_uri': 'sourceURI' - } - - def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 - """File - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._source_uri = None - self.discriminator = None - - if source_uri is not None: - self.source_uri = source_uri - - @property - def source_uri(self): - """Gets the source_uri of this File. # noqa: E501 - - Test capitalization # noqa: E501 - - :return: The source_uri of this File. # noqa: E501 - :rtype: str - """ - return self._source_uri - - @source_uri.setter - def source_uri(self, source_uri): - """Sets the source_uri of this File. - - Test capitalization # noqa: E501 - - :param source_uri: The source_uri of this File. # noqa: E501 - :type source_uri: str - """ - - self._source_uri = source_uri - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, File): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, File): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/file_schema_test_class.py deleted file mode 100644 index c5a23842d4f6..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/file_schema_test_class.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FileSchemaTestClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'file': 'File', - 'files': 'list[File]' - } - - attribute_map = { - 'file': 'file', - 'files': 'files' - } - - def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._file = None - self._files = None - self.discriminator = None - - if file is not None: - self.file = file - if files is not None: - self.files = files - - @property - def file(self): - """Gets the file of this FileSchemaTestClass. # noqa: E501 - - - :return: The file of this FileSchemaTestClass. # noqa: E501 - :rtype: File - """ - return self._file - - @file.setter - def file(self, file): - """Sets the file of this FileSchemaTestClass. - - - :param file: The file of this FileSchemaTestClass. # noqa: E501 - :type file: File - """ - - self._file = file - - @property - def files(self): - """Gets the files of this FileSchemaTestClass. # noqa: E501 - - - :return: The files of this FileSchemaTestClass. # noqa: E501 - :rtype: list[File] - """ - return self._files - - @files.setter - def files(self, files): - """Sets the files of this FileSchemaTestClass. - - - :param files: The files of this FileSchemaTestClass. # noqa: E501 - :type files: list[File] - """ - - self._files = files - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FileSchemaTestClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FileSchemaTestClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py deleted file mode 100644 index 452582251a59..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py +++ /dev/null @@ -1,515 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FormatTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'byte': 'str', - 'binary': 'file', - 'date': 'date', - 'date_time': 'datetime', - 'uuid': 'str', - 'password': 'str', - 'big_decimal': 'Decimal' - } - - attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password', - 'big_decimal': 'BigDecimal' - } - - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None, local_vars_configuration=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer = None - self._int32 = None - self._int64 = None - self._number = None - self._float = None - self._double = None - self._string = None - self._byte = None - self._binary = None - self._date = None - self._date_time = None - self._uuid = None - self._password = None - self._big_decimal = None - self.discriminator = None - - if integer is not None: - self.integer = integer - if int32 is not None: - self.int32 = int32 - if int64 is not None: - self.int64 = int64 - self.number = number - if float is not None: - self.float = float - if double is not None: - self.double = double - if string is not None: - self.string = string - self.byte = byte - if binary is not None: - self.binary = binary - self.date = date - if date_time is not None: - self.date_time = date_time - if uuid is not None: - self.uuid = uuid - self.password = password - if big_decimal is not None: - self.big_decimal = big_decimal - - @property - def integer(self): - """Gets the integer of this FormatTest. # noqa: E501 - - - :return: The integer of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this FormatTest. - - - :param integer: The integer of this FormatTest. # noqa: E501 - :type integer: int - """ - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer > 100): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer < 10): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - - self._integer = integer - - @property - def int32(self): - """Gets the int32 of this FormatTest. # noqa: E501 - - - :return: The int32 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int32 - - @int32.setter - def int32(self, int32): - """Sets the int32 of this FormatTest. - - - :param int32: The int32 of this FormatTest. # noqa: E501 - :type int32: int - """ - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 > 200): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 < 20): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - - self._int32 = int32 - - @property - def int64(self): - """Gets the int64 of this FormatTest. # noqa: E501 - - - :return: The int64 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int64 - - @int64.setter - def int64(self, int64): - """Sets the int64 of this FormatTest. - - - :param int64: The int64 of this FormatTest. # noqa: E501 - :type int64: int - """ - - self._int64 = int64 - - @property - def number(self): - """Gets the number of this FormatTest. # noqa: E501 - - - :return: The number of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this FormatTest. - - - :param number: The number of this FormatTest. # noqa: E501 - :type number: float - """ - if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number > 543.2): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number < 32.1): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - - self._number = number - - @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 - - - :return: The float of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._float - - @float.setter - def float(self, float): - """Sets the float of this FormatTest. - - - :param float: The float of this FormatTest. # noqa: E501 - :type float: float - """ - if (self.local_vars_configuration.client_side_validation and - float is not None and float > 987.6): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - float is not None and float < 54.3): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 - - self._float = float - - @property - def double(self): - """Gets the double of this FormatTest. # noqa: E501 - - - :return: The double of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._double - - @double.setter - def double(self, double): - """Sets the double of this FormatTest. - - - :param double: The double of this FormatTest. # noqa: E501 - :type double: float - """ - if (self.local_vars_configuration.client_side_validation and - double is not None and double > 123.4): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double < 67.8): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - - self._double = double - - @property - def string(self): - """Gets the string of this FormatTest. # noqa: E501 - - - :return: The string of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this FormatTest. - - - :param string: The string of this FormatTest. # noqa: E501 - :type string: str - """ - if (self.local_vars_configuration.client_side_validation and - string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - - self._string = string - - @property - def byte(self): - """Gets the byte of this FormatTest. # noqa: E501 - - - :return: The byte of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._byte - - @byte.setter - def byte(self, byte): - """Sets the byte of this FormatTest. - - - :param byte: The byte of this FormatTest. # noqa: E501 - :type byte: str - """ - if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501 - raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 - - self._byte = byte - - @property - def binary(self): - """Gets the binary of this FormatTest. # noqa: E501 - - - :return: The binary of this FormatTest. # noqa: E501 - :rtype: file - """ - return self._binary - - @binary.setter - def binary(self, binary): - """Sets the binary of this FormatTest. - - - :param binary: The binary of this FormatTest. # noqa: E501 - :type binary: file - """ - - self._binary = binary - - @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 - - - :return: The date of this FormatTest. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this FormatTest. - - - :param date: The date of this FormatTest. # noqa: E501 - :type date: date - """ - if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def date_time(self): - """Gets the date_time of this FormatTest. # noqa: E501 - - - :return: The date_time of this FormatTest. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this FormatTest. - - - :param date_time: The date_time of this FormatTest. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def uuid(self): - """Gets the uuid of this FormatTest. # noqa: E501 - - - :return: The uuid of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this FormatTest. - - - :param uuid: The uuid of this FormatTest. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def password(self): - """Gets the password of this FormatTest. # noqa: E501 - - - :return: The password of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this FormatTest. - - - :param password: The password of this FormatTest. # noqa: E501 - :type password: str - """ - if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) > 64): - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) < 10): - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - - self._password = password - - @property - def big_decimal(self): - """Gets the big_decimal of this FormatTest. # noqa: E501 - - - :return: The big_decimal of this FormatTest. # noqa: E501 - :rtype: Decimal - """ - return self._big_decimal - - @big_decimal.setter - def big_decimal(self, big_decimal): - """Sets the big_decimal of this FormatTest. - - - :param big_decimal: The big_decimal of this FormatTest. # noqa: E501 - :type big_decimal: Decimal - """ - - self._big_decimal = big_decimal - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FormatTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FormatTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py deleted file mode 100644 index 7175c2acc721..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class HasOnlyReadOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'foo': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'foo': 'foo' - } - - def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._foo = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if foo is not None: - self.foo = foo - - @property - def bar(self): - """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - - - :return: The bar of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this HasOnlyReadOnly. - - - :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def foo(self): - """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - - - :return: The foo of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._foo - - @foo.setter - def foo(self, foo): - """Sets the foo of this HasOnlyReadOnly. - - - :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 - :type foo: str - """ - - self._foo = foo - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HasOnlyReadOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, HasOnlyReadOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/list.py b/samples/client/petstore/python-asyncio/petstore_api/models/list.py deleted file mode 100644 index 6e1dea4e33b5..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/list.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class List(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_123_list': 'str' - } - - attribute_map = { - '_123_list': '123-list' - } - - def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 - """List - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__123_list = None - self.discriminator = None - - if _123_list is not None: - self._123_list = _123_list - - @property - def _123_list(self): - """Gets the _123_list of this List. # noqa: E501 - - - :return: The _123_list of this List. # noqa: E501 - :rtype: str - """ - return self.__123_list - - @_123_list.setter - def _123_list(self, _123_list): - """Sets the _123_list of this List. - - - :param _123_list: The _123_list of this List. # noqa: E501 - :type _123_list: str - """ - - self.__123_list = _123_list - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, List): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, List): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py deleted file mode 100644 index 606253a90d9e..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MapTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_map_of_string': 'dict[str, dict[str, str]]', - 'map_of_enum_string': 'dict[str, str]', - 'direct_map': 'dict[str, bool]', - 'indirect_map': 'dict[str, bool]' - } - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string', - 'direct_map': 'direct_map', - 'indirect_map': 'indirect_map' - } - - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 - """MapTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_map_of_string = None - self._map_of_enum_string = None - self._direct_map = None - self._indirect_map = None - self.discriminator = None - - if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string - if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string - if direct_map is not None: - self.direct_map = direct_map - if indirect_map is not None: - self.indirect_map = indirect_map - - @property - def map_map_of_string(self): - """Gets the map_map_of_string of this MapTest. # noqa: E501 - - - :return: The map_map_of_string of this MapTest. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_of_string - - @map_map_of_string.setter - def map_map_of_string(self, map_map_of_string): - """Sets the map_map_of_string of this MapTest. - - - :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 - :type map_map_of_string: dict[str, dict[str, str]] - """ - - self._map_map_of_string = map_map_of_string - - @property - def map_of_enum_string(self): - """Gets the map_of_enum_string of this MapTest. # noqa: E501 - - - :return: The map_of_enum_string of this MapTest. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_of_enum_string - - @map_of_enum_string.setter - def map_of_enum_string(self, map_of_enum_string): - """Sets the map_of_enum_string of this MapTest. - - - :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 - :type map_of_enum_string: dict[str, str] - """ - allowed_values = ["UPPER", "lower"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._map_of_enum_string = map_of_enum_string - - @property - def direct_map(self): - """Gets the direct_map of this MapTest. # noqa: E501 - - - :return: The direct_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._direct_map - - @direct_map.setter - def direct_map(self, direct_map): - """Sets the direct_map of this MapTest. - - - :param direct_map: The direct_map of this MapTest. # noqa: E501 - :type direct_map: dict[str, bool] - """ - - self._direct_map = direct_map - - @property - def indirect_map(self): - """Gets the indirect_map of this MapTest. # noqa: E501 - - - :return: The indirect_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._indirect_map - - @indirect_map.setter - def indirect_map(self, indirect_map): - """Sets the indirect_map of this MapTest. - - - :param indirect_map: The indirect_map of this MapTest. # noqa: E501 - :type indirect_map: dict[str, bool] - """ - - self._indirect_map = indirect_map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MapTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MapTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 96aedc145c40..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MixedPropertiesAndAdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict[str, Animal]' - } - - attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' - } - - def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._uuid = None - self._date_time = None - self._map = None - self.discriminator = None - - if uuid is not None: - self.uuid = uuid - if date_time is not None: - self.date_time = date_time - if map is not None: - self.map = map - - @property - def uuid(self): - """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def date_time(self): - """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def map(self): - """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, Animal] - """ - return self._map - - @map.setter - def map(self, map): - """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type map: dict[str, Animal] - """ - - self._map = map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py deleted file mode 100644 index db587fd24e2f..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - - :return: The name of this Model200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model200Response. - - - :param name: The name of this Model200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - - :return: The _class of this Model200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model200Response. - - - :param _class: The _class of this Model200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py deleted file mode 100644 index 96498ac6b1df..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model_200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model_200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model_200Response. # noqa: E501 - - - :return: The name of this Model_200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model_200Response. - - - :param name: The name of this Model_200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model_200Response. # noqa: E501 - - - :return: The _class of this Model_200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model_200Response. - - - :param _class: The _class of this Model_200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model_200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model_200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py deleted file mode 100644 index 5354fd56e2ce..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ModelReturn(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_return': 'int' - } - - attribute_map = { - '_return': 'return' - } - - def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__return = None - self.discriminator = None - - if _return is not None: - self._return = _return - - @property - def _return(self): - """Gets the _return of this ModelReturn. # noqa: E501 - - - :return: The _return of this ModelReturn. # noqa: E501 - :rtype: int - """ - return self.__return - - @_return.setter - def _return(self, _return): - """Sets the _return of this ModelReturn. - - - :param _return: The _return of this ModelReturn. # noqa: E501 - :type _return: int - """ - - self.__return = _return - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ModelReturn): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ModelReturn): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/name.py b/samples/client/petstore/python-asyncio/petstore_api/models/name.py deleted file mode 100644 index 0191a3a934ae..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/name.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Name(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int' - } - - attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' - } - - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 - """Name - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._snake_case = None - self.__property = None - self.__123_number = None - self.discriminator = None - - self.name = name - if snake_case is not None: - self.snake_case = snake_case - if _property is not None: - self._property = _property - if _123_number is not None: - self._123_number = _123_number - - @property - def name(self): - """Gets the name of this Name. # noqa: E501 - - - :return: The name of this Name. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Name. - - - :param name: The name of this Name. # noqa: E501 - :type name: int - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def snake_case(self): - """Gets the snake_case of this Name. # noqa: E501 - - - :return: The snake_case of this Name. # noqa: E501 - :rtype: int - """ - return self._snake_case - - @snake_case.setter - def snake_case(self, snake_case): - """Sets the snake_case of this Name. - - - :param snake_case: The snake_case of this Name. # noqa: E501 - :type snake_case: int - """ - - self._snake_case = snake_case - - @property - def _property(self): - """Gets the _property of this Name. # noqa: E501 - - - :return: The _property of this Name. # noqa: E501 - :rtype: str - """ - return self.__property - - @_property.setter - def _property(self, _property): - """Sets the _property of this Name. - - - :param _property: The _property of this Name. # noqa: E501 - :type _property: str - """ - - self.__property = _property - - @property - def _123_number(self): - """Gets the _123_number of this Name. # noqa: E501 - - - :return: The _123_number of this Name. # noqa: E501 - :rtype: int - """ - return self.__123_number - - @_123_number.setter - def _123_number(self, _123_number): - """Sets the _123_number of this Name. - - - :param _123_number: The _123_number of this Name. # noqa: E501 - :type _123_number: int - """ - - self.__123_number = _123_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Name): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Name): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py deleted file mode 100644 index 59a252e0bb66..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class NumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_number': 'float' - } - - attribute_map = { - 'just_number': 'JustNumber' - } - - def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_number = None - self.discriminator = None - - if just_number is not None: - self.just_number = just_number - - @property - def just_number(self): - """Gets the just_number of this NumberOnly. # noqa: E501 - - - :return: The just_number of this NumberOnly. # noqa: E501 - :rtype: float - """ - return self._just_number - - @just_number.setter - def just_number(self, just_number): - """Sets the just_number of this NumberOnly. - - - :param just_number: The just_number of this NumberOnly. # noqa: E501 - :type just_number: float - """ - - self._just_number = just_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, NumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/order.py b/samples/client/petstore/python-asyncio/petstore_api/models/order.py deleted file mode 100644 index a267324d0d19..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/order.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Order(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool' - } - - attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } - - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 - """Order - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._pet_id = None - self._quantity = None - self._ship_date = None - self._status = None - self._complete = None - self.discriminator = None - - if id is not None: - self.id = id - if pet_id is not None: - self.pet_id = pet_id - if quantity is not None: - self.quantity = quantity - if ship_date is not None: - self.ship_date = ship_date - if status is not None: - self.status = status - if complete is not None: - self.complete = complete - - @property - def id(self): - """Gets the id of this Order. # noqa: E501 - - - :return: The id of this Order. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Order. - - - :param id: The id of this Order. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def pet_id(self): - """Gets the pet_id of this Order. # noqa: E501 - - - :return: The pet_id of this Order. # noqa: E501 - :rtype: int - """ - return self._pet_id - - @pet_id.setter - def pet_id(self, pet_id): - """Sets the pet_id of this Order. - - - :param pet_id: The pet_id of this Order. # noqa: E501 - :type pet_id: int - """ - - self._pet_id = pet_id - - @property - def quantity(self): - """Gets the quantity of this Order. # noqa: E501 - - - :return: The quantity of this Order. # noqa: E501 - :rtype: int - """ - return self._quantity - - @quantity.setter - def quantity(self, quantity): - """Sets the quantity of this Order. - - - :param quantity: The quantity of this Order. # noqa: E501 - :type quantity: int - """ - - self._quantity = quantity - - @property - def ship_date(self): - """Gets the ship_date of this Order. # noqa: E501 - - - :return: The ship_date of this Order. # noqa: E501 - :rtype: datetime - """ - return self._ship_date - - @ship_date.setter - def ship_date(self, ship_date): - """Sets the ship_date of this Order. - - - :param ship_date: The ship_date of this Order. # noqa: E501 - :type ship_date: datetime - """ - - self._ship_date = ship_date - - @property - def status(self): - """Gets the status of this Order. # noqa: E501 - - Order Status # noqa: E501 - - :return: The status of this Order. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Order. - - Order Status # noqa: E501 - - :param status: The status of this Order. # noqa: E501 - :type status: str - """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def complete(self): - """Gets the complete of this Order. # noqa: E501 - - - :return: The complete of this Order. # noqa: E501 - :rtype: bool - """ - return self._complete - - @complete.setter - def complete(self, complete): - """Sets the complete of this Order. - - - :param complete: The complete of this Order. # noqa: E501 - :type complete: bool - """ - - self._complete = complete - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Order): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Order): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py deleted file mode 100644 index e26160ab4302..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterComposite(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'my_number': 'float', - 'my_string': 'str', - 'my_boolean': 'bool' - } - - attribute_map = { - 'my_number': 'my_number', - 'my_string': 'my_string', - 'my_boolean': 'my_boolean' - } - - def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._my_number = None - self._my_string = None - self._my_boolean = None - self.discriminator = None - - if my_number is not None: - self.my_number = my_number - if my_string is not None: - self.my_string = my_string - if my_boolean is not None: - self.my_boolean = my_boolean - - @property - def my_number(self): - """Gets the my_number of this OuterComposite. # noqa: E501 - - - :return: The my_number of this OuterComposite. # noqa: E501 - :rtype: float - """ - return self._my_number - - @my_number.setter - def my_number(self, my_number): - """Sets the my_number of this OuterComposite. - - - :param my_number: The my_number of this OuterComposite. # noqa: E501 - :type my_number: float - """ - - self._my_number = my_number - - @property - def my_string(self): - """Gets the my_string of this OuterComposite. # noqa: E501 - - - :return: The my_string of this OuterComposite. # noqa: E501 - :rtype: str - """ - return self._my_string - - @my_string.setter - def my_string(self, my_string): - """Sets the my_string of this OuterComposite. - - - :param my_string: The my_string of this OuterComposite. # noqa: E501 - :type my_string: str - """ - - self._my_string = my_string - - @property - def my_boolean(self): - """Gets the my_boolean of this OuterComposite. # noqa: E501 - - - :return: The my_boolean of this OuterComposite. # noqa: E501 - :rtype: bool - """ - return self._my_boolean - - @my_boolean.setter - def my_boolean(self, my_boolean): - """Sets the my_boolean of this OuterComposite. - - - :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 - :type my_boolean: bool - """ - - self._my_boolean = my_boolean - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterComposite): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterComposite): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py deleted file mode 100644 index 27cdfd1fb791..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnum(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - - allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnum - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnum): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnum): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py deleted file mode 100644 index 22bb4a585e47..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Pet(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'category': 'Category', - 'name': 'str', - 'photo_urls': 'list[str]', - 'tags': 'list[Tag]', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } - - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 - """Pet - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._category = None - self._name = None - self._photo_urls = None - self._tags = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - if category is not None: - self.category = category - self.name = name - self.photo_urls = photo_urls - if tags is not None: - self.tags = tags - if status is not None: - self.status = status - - @property - def id(self): - """Gets the id of this Pet. # noqa: E501 - - - :return: The id of this Pet. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Pet. - - - :param id: The id of this Pet. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def category(self): - """Gets the category of this Pet. # noqa: E501 - - - :return: The category of this Pet. # noqa: E501 - :rtype: Category - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Pet. - - - :param category: The category of this Pet. # noqa: E501 - :type category: Category - """ - - self._category = category - - @property - def name(self): - """Gets the name of this Pet. # noqa: E501 - - - :return: The name of this Pet. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Pet. - - - :param name: The name of this Pet. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. # noqa: E501 - - - :return: The photo_urls of this Pet. # noqa: E501 - :rtype: list[str] - """ - return self._photo_urls - - @photo_urls.setter - def photo_urls(self, photo_urls): - """Sets the photo_urls of this Pet. - - - :param photo_urls: The photo_urls of this Pet. # noqa: E501 - :type photo_urls: list[str] - """ - if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 - raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 - - self._photo_urls = photo_urls - - @property - def tags(self): - """Gets the tags of this Pet. # noqa: E501 - - - :return: The tags of this Pet. # noqa: E501 - :rtype: list[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Pet. - - - :param tags: The tags of this Pet. # noqa: E501 - :type tags: list[Tag] - """ - - self._tags = tags - - @property - def status(self): - """Gets the status of this Pet. # noqa: E501 - - pet status in the store # noqa: E501 - - :return: The status of this Pet. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Pet. - - pet status in the store # noqa: E501 - - :param status: The status of this Pet. # noqa: E501 - :type status: str - """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Pet): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Pet): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py deleted file mode 100644 index c2888eba7500..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ReadOnlyFirst(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'baz': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'baz': 'baz' - } - - def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._baz = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if baz is not None: - self.baz = baz - - @property - def bar(self): - """Gets the bar of this ReadOnlyFirst. # noqa: E501 - - - :return: The bar of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this ReadOnlyFirst. - - - :param bar: The bar of this ReadOnlyFirst. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def baz(self): - """Gets the baz of this ReadOnlyFirst. # noqa: E501 - - - :return: The baz of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._baz - - @baz.setter - def baz(self, baz): - """Sets the baz of this ReadOnlyFirst. - - - :param baz: The baz of this ReadOnlyFirst. # noqa: E501 - :type baz: str - """ - - self._baz = baz - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ReadOnlyFirst): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ReadOnlyFirst): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py deleted file mode 100644 index 4c848e1887c0..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialModelName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'special_property_name': 'int' - } - - attribute_map = { - 'special_property_name': '$special[property.name]' - } - - def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._special_property_name = None - self.discriminator = None - - if special_property_name is not None: - self.special_property_name = special_property_name - - @property - def special_property_name(self): - """Gets the special_property_name of this SpecialModelName. # noqa: E501 - - - :return: The special_property_name of this SpecialModelName. # noqa: E501 - :rtype: int - """ - return self._special_property_name - - @special_property_name.setter - def special_property_name(self, special_property_name): - """Sets the special_property_name of this SpecialModelName. - - - :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 - :type special_property_name: int - """ - - self._special_property_name = special_property_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialModelName): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialModelName): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py deleted file mode 100644 index a3e6789078d8..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Tag(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 - """Tag - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - - :return: The id of this Tag. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - - :return: The name of this Tag. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - - :param name: The name of this Tag. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Tag): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py deleted file mode 100644 index 582b4c8d6dc2..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py +++ /dev/null @@ -1,240 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderDefault(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderDefault. # noqa: E501 - - - :return: The string_item of this TypeHolderDefault. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderDefault. - - - :param string_item: The string_item of this TypeHolderDefault. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderDefault. # noqa: E501 - - - :return: The number_item of this TypeHolderDefault. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderDefault. - - - :param number_item: The number_item of this TypeHolderDefault. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderDefault. # noqa: E501 - - - :return: The integer_item of this TypeHolderDefault. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderDefault. - - - :param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderDefault. # noqa: E501 - - - :return: The bool_item of this TypeHolderDefault. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderDefault. - - - :param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderDefault. # noqa: E501 - - - :return: The array_item of this TypeHolderDefault. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderDefault. - - - :param array_item: The array_item of this TypeHolderDefault. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderDefault): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderDefault): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py deleted file mode 100644 index 268595ed8681..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py +++ /dev/null @@ -1,267 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderExample(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'float_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'float_item': 'float_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._float_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.float_item = float_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderExample. # noqa: E501 - - - :return: The string_item of this TypeHolderExample. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderExample. - - - :param string_item: The string_item of this TypeHolderExample. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderExample. # noqa: E501 - - - :return: The number_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderExample. - - - :param number_item: The number_item of this TypeHolderExample. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def float_item(self): - """Gets the float_item of this TypeHolderExample. # noqa: E501 - - - :return: The float_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._float_item - - @float_item.setter - def float_item(self, float_item): - """Sets the float_item of this TypeHolderExample. - - - :param float_item: The float_item of this TypeHolderExample. # noqa: E501 - :type float_item: float - """ - if self.local_vars_configuration.client_side_validation and float_item is None: # noqa: E501 - raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 - - self._float_item = float_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderExample. # noqa: E501 - - - :return: The integer_item of this TypeHolderExample. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderExample. - - - :param integer_item: The integer_item of this TypeHolderExample. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderExample. # noqa: E501 - - - :return: The bool_item of this TypeHolderExample. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderExample. - - - :param bool_item: The bool_item of this TypeHolderExample. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderExample. # noqa: E501 - - - :return: The array_item of this TypeHolderExample. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderExample. - - - :param array_item: The array_item of this TypeHolderExample. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderExample): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderExample): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/user.py b/samples/client/petstore/python-asyncio/petstore_api/models/user.py deleted file mode 100644 index 7ae2898f6c5a..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/user.py +++ /dev/null @@ -1,315 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class User(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int' - } - - attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } - - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 - """User - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._username = None - self._first_name = None - self._last_name = None - self._email = None - self._password = None - self._phone = None - self._user_status = None - self.discriminator = None - - if id is not None: - self.id = id - if username is not None: - self.username = username - if first_name is not None: - self.first_name = first_name - if last_name is not None: - self.last_name = last_name - if email is not None: - self.email = email - if password is not None: - self.password = password - if phone is not None: - self.phone = phone - if user_status is not None: - self.user_status = user_status - - @property - def id(self): - """Gets the id of this User. # noqa: E501 - - - :return: The id of this User. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this User. - - - :param id: The id of this User. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def username(self): - """Gets the username of this User. # noqa: E501 - - - :return: The username of this User. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this User. - - - :param username: The username of this User. # noqa: E501 - :type username: str - """ - - self._username = username - - @property - def first_name(self): - """Gets the first_name of this User. # noqa: E501 - - - :return: The first_name of this User. # noqa: E501 - :rtype: str - """ - return self._first_name - - @first_name.setter - def first_name(self, first_name): - """Sets the first_name of this User. - - - :param first_name: The first_name of this User. # noqa: E501 - :type first_name: str - """ - - self._first_name = first_name - - @property - def last_name(self): - """Gets the last_name of this User. # noqa: E501 - - - :return: The last_name of this User. # noqa: E501 - :rtype: str - """ - return self._last_name - - @last_name.setter - def last_name(self, last_name): - """Sets the last_name of this User. - - - :param last_name: The last_name of this User. # noqa: E501 - :type last_name: str - """ - - self._last_name = last_name - - @property - def email(self): - """Gets the email of this User. # noqa: E501 - - - :return: The email of this User. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this User. - - - :param email: The email of this User. # noqa: E501 - :type email: str - """ - - self._email = email - - @property - def password(self): - """Gets the password of this User. # noqa: E501 - - - :return: The password of this User. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this User. - - - :param password: The password of this User. # noqa: E501 - :type password: str - """ - - self._password = password - - @property - def phone(self): - """Gets the phone of this User. # noqa: E501 - - - :return: The phone of this User. # noqa: E501 - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this User. - - - :param phone: The phone of this User. # noqa: E501 - :type phone: str - """ - - self._phone = phone - - @property - def user_status(self): - """Gets the user_status of this User. # noqa: E501 - - User Status # noqa: E501 - - :return: The user_status of this User. # noqa: E501 - :rtype: int - """ - return self._user_status - - @user_status.setter - def user_status(self, user_status): - """Sets the user_status of this User. - - User Status # noqa: E501 - - :param user_status: The user_status of this User. # noqa: E501 - :type user_status: int - """ - - self._user_status = user_status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, User): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, User): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/xml_item.py b/samples/client/petstore/python-asyncio/petstore_api/models/xml_item.py deleted file mode 100644 index 5e6fecdd71c8..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/models/xml_item.py +++ /dev/null @@ -1,859 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class XmlItem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'attribute_string': 'str', - 'attribute_number': 'float', - 'attribute_integer': 'int', - 'attribute_boolean': 'bool', - 'wrapped_array': 'list[int]', - 'name_string': 'str', - 'name_number': 'float', - 'name_integer': 'int', - 'name_boolean': 'bool', - 'name_array': 'list[int]', - 'name_wrapped_array': 'list[int]', - 'prefix_string': 'str', - 'prefix_number': 'float', - 'prefix_integer': 'int', - 'prefix_boolean': 'bool', - 'prefix_array': 'list[int]', - 'prefix_wrapped_array': 'list[int]', - 'namespace_string': 'str', - 'namespace_number': 'float', - 'namespace_integer': 'int', - 'namespace_boolean': 'bool', - 'namespace_array': 'list[int]', - 'namespace_wrapped_array': 'list[int]', - 'prefix_ns_string': 'str', - 'prefix_ns_number': 'float', - 'prefix_ns_integer': 'int', - 'prefix_ns_boolean': 'bool', - 'prefix_ns_array': 'list[int]', - 'prefix_ns_wrapped_array': 'list[int]' - } - - attribute_map = { - 'attribute_string': 'attribute_string', - 'attribute_number': 'attribute_number', - 'attribute_integer': 'attribute_integer', - 'attribute_boolean': 'attribute_boolean', - 'wrapped_array': 'wrapped_array', - 'name_string': 'name_string', - 'name_number': 'name_number', - 'name_integer': 'name_integer', - 'name_boolean': 'name_boolean', - 'name_array': 'name_array', - 'name_wrapped_array': 'name_wrapped_array', - 'prefix_string': 'prefix_string', - 'prefix_number': 'prefix_number', - 'prefix_integer': 'prefix_integer', - 'prefix_boolean': 'prefix_boolean', - 'prefix_array': 'prefix_array', - 'prefix_wrapped_array': 'prefix_wrapped_array', - 'namespace_string': 'namespace_string', - 'namespace_number': 'namespace_number', - 'namespace_integer': 'namespace_integer', - 'namespace_boolean': 'namespace_boolean', - 'namespace_array': 'namespace_array', - 'namespace_wrapped_array': 'namespace_wrapped_array', - 'prefix_ns_string': 'prefix_ns_string', - 'prefix_ns_number': 'prefix_ns_number', - 'prefix_ns_integer': 'prefix_ns_integer', - 'prefix_ns_boolean': 'prefix_ns_boolean', - 'prefix_ns_array': 'prefix_ns_array', - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' - } - - def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None, local_vars_configuration=None): # noqa: E501 - """XmlItem - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._attribute_string = None - self._attribute_number = None - self._attribute_integer = None - self._attribute_boolean = None - self._wrapped_array = None - self._name_string = None - self._name_number = None - self._name_integer = None - self._name_boolean = None - self._name_array = None - self._name_wrapped_array = None - self._prefix_string = None - self._prefix_number = None - self._prefix_integer = None - self._prefix_boolean = None - self._prefix_array = None - self._prefix_wrapped_array = None - self._namespace_string = None - self._namespace_number = None - self._namespace_integer = None - self._namespace_boolean = None - self._namespace_array = None - self._namespace_wrapped_array = None - self._prefix_ns_string = None - self._prefix_ns_number = None - self._prefix_ns_integer = None - self._prefix_ns_boolean = None - self._prefix_ns_array = None - self._prefix_ns_wrapped_array = None - self.discriminator = None - - if attribute_string is not None: - self.attribute_string = attribute_string - if attribute_number is not None: - self.attribute_number = attribute_number - if attribute_integer is not None: - self.attribute_integer = attribute_integer - if attribute_boolean is not None: - self.attribute_boolean = attribute_boolean - if wrapped_array is not None: - self.wrapped_array = wrapped_array - if name_string is not None: - self.name_string = name_string - if name_number is not None: - self.name_number = name_number - if name_integer is not None: - self.name_integer = name_integer - if name_boolean is not None: - self.name_boolean = name_boolean - if name_array is not None: - self.name_array = name_array - if name_wrapped_array is not None: - self.name_wrapped_array = name_wrapped_array - if prefix_string is not None: - self.prefix_string = prefix_string - if prefix_number is not None: - self.prefix_number = prefix_number - if prefix_integer is not None: - self.prefix_integer = prefix_integer - if prefix_boolean is not None: - self.prefix_boolean = prefix_boolean - if prefix_array is not None: - self.prefix_array = prefix_array - if prefix_wrapped_array is not None: - self.prefix_wrapped_array = prefix_wrapped_array - if namespace_string is not None: - self.namespace_string = namespace_string - if namespace_number is not None: - self.namespace_number = namespace_number - if namespace_integer is not None: - self.namespace_integer = namespace_integer - if namespace_boolean is not None: - self.namespace_boolean = namespace_boolean - if namespace_array is not None: - self.namespace_array = namespace_array - if namespace_wrapped_array is not None: - self.namespace_wrapped_array = namespace_wrapped_array - if prefix_ns_string is not None: - self.prefix_ns_string = prefix_ns_string - if prefix_ns_number is not None: - self.prefix_ns_number = prefix_ns_number - if prefix_ns_integer is not None: - self.prefix_ns_integer = prefix_ns_integer - if prefix_ns_boolean is not None: - self.prefix_ns_boolean = prefix_ns_boolean - if prefix_ns_array is not None: - self.prefix_ns_array = prefix_ns_array - if prefix_ns_wrapped_array is not None: - self.prefix_ns_wrapped_array = prefix_ns_wrapped_array - - @property - def attribute_string(self): - """Gets the attribute_string of this XmlItem. # noqa: E501 - - - :return: The attribute_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._attribute_string - - @attribute_string.setter - def attribute_string(self, attribute_string): - """Sets the attribute_string of this XmlItem. - - - :param attribute_string: The attribute_string of this XmlItem. # noqa: E501 - :type attribute_string: str - """ - - self._attribute_string = attribute_string - - @property - def attribute_number(self): - """Gets the attribute_number of this XmlItem. # noqa: E501 - - - :return: The attribute_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._attribute_number - - @attribute_number.setter - def attribute_number(self, attribute_number): - """Sets the attribute_number of this XmlItem. - - - :param attribute_number: The attribute_number of this XmlItem. # noqa: E501 - :type attribute_number: float - """ - - self._attribute_number = attribute_number - - @property - def attribute_integer(self): - """Gets the attribute_integer of this XmlItem. # noqa: E501 - - - :return: The attribute_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._attribute_integer - - @attribute_integer.setter - def attribute_integer(self, attribute_integer): - """Sets the attribute_integer of this XmlItem. - - - :param attribute_integer: The attribute_integer of this XmlItem. # noqa: E501 - :type attribute_integer: int - """ - - self._attribute_integer = attribute_integer - - @property - def attribute_boolean(self): - """Gets the attribute_boolean of this XmlItem. # noqa: E501 - - - :return: The attribute_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._attribute_boolean - - @attribute_boolean.setter - def attribute_boolean(self, attribute_boolean): - """Sets the attribute_boolean of this XmlItem. - - - :param attribute_boolean: The attribute_boolean of this XmlItem. # noqa: E501 - :type attribute_boolean: bool - """ - - self._attribute_boolean = attribute_boolean - - @property - def wrapped_array(self): - """Gets the wrapped_array of this XmlItem. # noqa: E501 - - - :return: The wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._wrapped_array - - @wrapped_array.setter - def wrapped_array(self, wrapped_array): - """Sets the wrapped_array of this XmlItem. - - - :param wrapped_array: The wrapped_array of this XmlItem. # noqa: E501 - :type wrapped_array: list[int] - """ - - self._wrapped_array = wrapped_array - - @property - def name_string(self): - """Gets the name_string of this XmlItem. # noqa: E501 - - - :return: The name_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._name_string - - @name_string.setter - def name_string(self, name_string): - """Sets the name_string of this XmlItem. - - - :param name_string: The name_string of this XmlItem. # noqa: E501 - :type name_string: str - """ - - self._name_string = name_string - - @property - def name_number(self): - """Gets the name_number of this XmlItem. # noqa: E501 - - - :return: The name_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._name_number - - @name_number.setter - def name_number(self, name_number): - """Sets the name_number of this XmlItem. - - - :param name_number: The name_number of this XmlItem. # noqa: E501 - :type name_number: float - """ - - self._name_number = name_number - - @property - def name_integer(self): - """Gets the name_integer of this XmlItem. # noqa: E501 - - - :return: The name_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._name_integer - - @name_integer.setter - def name_integer(self, name_integer): - """Sets the name_integer of this XmlItem. - - - :param name_integer: The name_integer of this XmlItem. # noqa: E501 - :type name_integer: int - """ - - self._name_integer = name_integer - - @property - def name_boolean(self): - """Gets the name_boolean of this XmlItem. # noqa: E501 - - - :return: The name_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._name_boolean - - @name_boolean.setter - def name_boolean(self, name_boolean): - """Sets the name_boolean of this XmlItem. - - - :param name_boolean: The name_boolean of this XmlItem. # noqa: E501 - :type name_boolean: bool - """ - - self._name_boolean = name_boolean - - @property - def name_array(self): - """Gets the name_array of this XmlItem. # noqa: E501 - - - :return: The name_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_array - - @name_array.setter - def name_array(self, name_array): - """Sets the name_array of this XmlItem. - - - :param name_array: The name_array of this XmlItem. # noqa: E501 - :type name_array: list[int] - """ - - self._name_array = name_array - - @property - def name_wrapped_array(self): - """Gets the name_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The name_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_wrapped_array - - @name_wrapped_array.setter - def name_wrapped_array(self, name_wrapped_array): - """Sets the name_wrapped_array of this XmlItem. - - - :param name_wrapped_array: The name_wrapped_array of this XmlItem. # noqa: E501 - :type name_wrapped_array: list[int] - """ - - self._name_wrapped_array = name_wrapped_array - - @property - def prefix_string(self): - """Gets the prefix_string of this XmlItem. # noqa: E501 - - - :return: The prefix_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_string - - @prefix_string.setter - def prefix_string(self, prefix_string): - """Sets the prefix_string of this XmlItem. - - - :param prefix_string: The prefix_string of this XmlItem. # noqa: E501 - :type prefix_string: str - """ - - self._prefix_string = prefix_string - - @property - def prefix_number(self): - """Gets the prefix_number of this XmlItem. # noqa: E501 - - - :return: The prefix_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_number - - @prefix_number.setter - def prefix_number(self, prefix_number): - """Sets the prefix_number of this XmlItem. - - - :param prefix_number: The prefix_number of this XmlItem. # noqa: E501 - :type prefix_number: float - """ - - self._prefix_number = prefix_number - - @property - def prefix_integer(self): - """Gets the prefix_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_integer - - @prefix_integer.setter - def prefix_integer(self, prefix_integer): - """Sets the prefix_integer of this XmlItem. - - - :param prefix_integer: The prefix_integer of this XmlItem. # noqa: E501 - :type prefix_integer: int - """ - - self._prefix_integer = prefix_integer - - @property - def prefix_boolean(self): - """Gets the prefix_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_boolean - - @prefix_boolean.setter - def prefix_boolean(self, prefix_boolean): - """Sets the prefix_boolean of this XmlItem. - - - :param prefix_boolean: The prefix_boolean of this XmlItem. # noqa: E501 - :type prefix_boolean: bool - """ - - self._prefix_boolean = prefix_boolean - - @property - def prefix_array(self): - """Gets the prefix_array of this XmlItem. # noqa: E501 - - - :return: The prefix_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_array - - @prefix_array.setter - def prefix_array(self, prefix_array): - """Sets the prefix_array of this XmlItem. - - - :param prefix_array: The prefix_array of this XmlItem. # noqa: E501 - :type prefix_array: list[int] - """ - - self._prefix_array = prefix_array - - @property - def prefix_wrapped_array(self): - """Gets the prefix_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_wrapped_array - - @prefix_wrapped_array.setter - def prefix_wrapped_array(self, prefix_wrapped_array): - """Sets the prefix_wrapped_array of this XmlItem. - - - :param prefix_wrapped_array: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_wrapped_array: list[int] - """ - - self._prefix_wrapped_array = prefix_wrapped_array - - @property - def namespace_string(self): - """Gets the namespace_string of this XmlItem. # noqa: E501 - - - :return: The namespace_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._namespace_string - - @namespace_string.setter - def namespace_string(self, namespace_string): - """Sets the namespace_string of this XmlItem. - - - :param namespace_string: The namespace_string of this XmlItem. # noqa: E501 - :type namespace_string: str - """ - - self._namespace_string = namespace_string - - @property - def namespace_number(self): - """Gets the namespace_number of this XmlItem. # noqa: E501 - - - :return: The namespace_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._namespace_number - - @namespace_number.setter - def namespace_number(self, namespace_number): - """Sets the namespace_number of this XmlItem. - - - :param namespace_number: The namespace_number of this XmlItem. # noqa: E501 - :type namespace_number: float - """ - - self._namespace_number = namespace_number - - @property - def namespace_integer(self): - """Gets the namespace_integer of this XmlItem. # noqa: E501 - - - :return: The namespace_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._namespace_integer - - @namespace_integer.setter - def namespace_integer(self, namespace_integer): - """Sets the namespace_integer of this XmlItem. - - - :param namespace_integer: The namespace_integer of this XmlItem. # noqa: E501 - :type namespace_integer: int - """ - - self._namespace_integer = namespace_integer - - @property - def namespace_boolean(self): - """Gets the namespace_boolean of this XmlItem. # noqa: E501 - - - :return: The namespace_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._namespace_boolean - - @namespace_boolean.setter - def namespace_boolean(self, namespace_boolean): - """Sets the namespace_boolean of this XmlItem. - - - :param namespace_boolean: The namespace_boolean of this XmlItem. # noqa: E501 - :type namespace_boolean: bool - """ - - self._namespace_boolean = namespace_boolean - - @property - def namespace_array(self): - """Gets the namespace_array of this XmlItem. # noqa: E501 - - - :return: The namespace_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_array - - @namespace_array.setter - def namespace_array(self, namespace_array): - """Sets the namespace_array of this XmlItem. - - - :param namespace_array: The namespace_array of this XmlItem. # noqa: E501 - :type namespace_array: list[int] - """ - - self._namespace_array = namespace_array - - @property - def namespace_wrapped_array(self): - """Gets the namespace_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_wrapped_array - - @namespace_wrapped_array.setter - def namespace_wrapped_array(self, namespace_wrapped_array): - """Sets the namespace_wrapped_array of this XmlItem. - - - :param namespace_wrapped_array: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :type namespace_wrapped_array: list[int] - """ - - self._namespace_wrapped_array = namespace_wrapped_array - - @property - def prefix_ns_string(self): - """Gets the prefix_ns_string of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_ns_string - - @prefix_ns_string.setter - def prefix_ns_string(self, prefix_ns_string): - """Sets the prefix_ns_string of this XmlItem. - - - :param prefix_ns_string: The prefix_ns_string of this XmlItem. # noqa: E501 - :type prefix_ns_string: str - """ - - self._prefix_ns_string = prefix_ns_string - - @property - def prefix_ns_number(self): - """Gets the prefix_ns_number of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_ns_number - - @prefix_ns_number.setter - def prefix_ns_number(self, prefix_ns_number): - """Sets the prefix_ns_number of this XmlItem. - - - :param prefix_ns_number: The prefix_ns_number of this XmlItem. # noqa: E501 - :type prefix_ns_number: float - """ - - self._prefix_ns_number = prefix_ns_number - - @property - def prefix_ns_integer(self): - """Gets the prefix_ns_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_ns_integer - - @prefix_ns_integer.setter - def prefix_ns_integer(self, prefix_ns_integer): - """Sets the prefix_ns_integer of this XmlItem. - - - :param prefix_ns_integer: The prefix_ns_integer of this XmlItem. # noqa: E501 - :type prefix_ns_integer: int - """ - - self._prefix_ns_integer = prefix_ns_integer - - @property - def prefix_ns_boolean(self): - """Gets the prefix_ns_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_ns_boolean - - @prefix_ns_boolean.setter - def prefix_ns_boolean(self, prefix_ns_boolean): - """Sets the prefix_ns_boolean of this XmlItem. - - - :param prefix_ns_boolean: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :type prefix_ns_boolean: bool - """ - - self._prefix_ns_boolean = prefix_ns_boolean - - @property - def prefix_ns_array(self): - """Gets the prefix_ns_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_array - - @prefix_ns_array.setter - def prefix_ns_array(self, prefix_ns_array): - """Sets the prefix_ns_array of this XmlItem. - - - :param prefix_ns_array: The prefix_ns_array of this XmlItem. # noqa: E501 - :type prefix_ns_array: list[int] - """ - - self._prefix_ns_array = prefix_ns_array - - @property - def prefix_ns_wrapped_array(self): - """Gets the prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_wrapped_array - - @prefix_ns_wrapped_array.setter - def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): - """Sets the prefix_ns_wrapped_array of this XmlItem. - - - :param prefix_ns_wrapped_array: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_ns_wrapped_array: list[int] - """ - - self._prefix_ns_wrapped_array = prefix_ns_wrapped_array - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, XmlItem): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, XmlItem): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-asyncio/petstore_api/rest.py b/samples/client/petstore/python-asyncio/petstore_api/rest.py deleted file mode 100644 index 263fe1daafb5..000000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/rest.py +++ /dev/null @@ -1,247 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re -import ssl - -import aiohttp -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode - -from petstore_api.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp, data): - self.aiohttp_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = data - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.aiohttp_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - - # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize - - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) - if configuration.cert_file: - ssl_context.load_cert_chain( - configuration.cert_file, keyfile=configuration.key_file - ) - - if not configuration.verify_ssl: - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) - - self.proxy = configuration.proxy - self.proxy_headers = configuration.proxy_headers - - # https pool manager - self.pool_manager = aiohttp.ClientSession( - connector=connector, - trust_env=True - ) - - async def close(self): - await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Execute request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - timeout = _request_timeout or 5 * 60 - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - args = { - "method": method, - "url": url, - "timeout": timeout, - "headers": headers - } - - if self.proxy: - args["proxy"] = self.proxy - if self.proxy_headers: - args["proxy_headers"] = self.proxy_headers - - if query_params: - args["url"] += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body is not None: - body = json.dumps(body) - args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by aiohttp - del headers['Content-Type'] - data = aiohttp.FormData() - for param in post_params: - k, v = param - if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) - else: - data.add_field(k, v) - args["data"] = data - - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - args["data"] = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponse(r, data) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) diff --git a/samples/client/petstore/python-asyncio/pom.xml b/samples/client/petstore/python-asyncio/pom.xml deleted file mode 100644 index 6907f8a2a3e8..000000000000 --- a/samples/client/petstore/python-asyncio/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonAsyncioClientTests - pom - 1.0-SNAPSHOT - Python Asyncio Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pytest-test - integration-test - - exec - - - make - - test-all - - - - - - - - diff --git a/samples/client/petstore/python-asyncio/requirements.txt b/samples/client/petstore/python-asyncio/requirements.txt deleted file mode 100644 index d0518ec800e9..000000000000 --- a/samples/client/petstore/python-asyncio/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python-asyncio/setup.cfg b/samples/client/petstore/python-asyncio/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/client/petstore/python-asyncio/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/client/petstore/python-asyncio/setup.py b/samples/client/petstore/python-asyncio/setup.py deleted file mode 100644 index 974fea3373fe..000000000000 --- a/samples/client/petstore/python-asyncio/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] -REQUIRES.append("aiohttp >= 3.0.0") - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description_content_type='text/markdown', - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/client/petstore/python-asyncio/test-requirements.txt b/samples/client/petstore/python-asyncio/test-requirements.txt deleted file mode 100644 index 4ed3991cbec1..000000000000 --- a/samples/client/petstore/python-asyncio/test-requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/client/petstore/python-asyncio/test/__init__.py b/samples/client/petstore/python-asyncio/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_any_type.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_any_type.py deleted file mode 100644 index 4b6739a1faf3..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_any_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesAnyType(unittest.TestCase): - """AdditionalPropertiesAnyType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesAnyType(self): - """Test AdditionalPropertiesAnyType""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_array.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_array.py deleted file mode 100644 index c4cf43499cfa..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_array.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesArray(unittest.TestCase): - """AdditionalPropertiesArray unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesArray(self): - """Test AdditionalPropertiesArray""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_array.AdditionalPropertiesArray() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_boolean.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_boolean.py deleted file mode 100644 index cc3cecc8522f..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_boolean.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesBoolean(unittest.TestCase): - """AdditionalPropertiesBoolean unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesBoolean(self): - """Test AdditionalPropertiesBoolean""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_boolean.AdditionalPropertiesBoolean() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py deleted file mode 100644 index fc9df3bbb505..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_integer.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_integer.py deleted file mode 100644 index 774c367b2109..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_integer.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesInteger(unittest.TestCase): - """AdditionalPropertiesInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesInteger(self): - """Test AdditionalPropertiesInteger""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_integer.AdditionalPropertiesInteger() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_number.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_number.py deleted file mode 100644 index 0d370e781b36..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_number.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesNumber(unittest.TestCase): - """AdditionalPropertiesNumber unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesNumber(self): - """Test AdditionalPropertiesNumber""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_number.AdditionalPropertiesNumber() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_object.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_object.py deleted file mode 100644 index 6e718b28cdef..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesObject(unittest.TestCase): - """AdditionalPropertiesObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesObject(self): - """Test AdditionalPropertiesObject""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_string.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_string.py deleted file mode 100644 index a46cb3e256dc..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_string.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesString(unittest.TestCase): - """AdditionalPropertiesString unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesString(self): - """Test AdditionalPropertiesString""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_string.AdditionalPropertiesString() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_animal.py b/samples/client/petstore/python-asyncio/test/test_animal.py deleted file mode 100644 index 179f1fbd0e52..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_animal.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.animal.Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_another_fake_api.py b/samples/client/petstore/python-asyncio/test/test_another_fake_api.py deleted file mode 100644 index 4b80dc4eda52..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_another_fake_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_test_special_tags(self): - """Test case for test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_api_response.py b/samples/client/petstore/python-asyncio/test/test_api_response.py deleted file mode 100644 index 5031b458a0db..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_api_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py deleted file mode 100644 index a02233045421..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py deleted file mode 100644 index 1a928bf7d2e0..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_test.py b/samples/client/petstore/python-asyncio/test/test_array_test.py deleted file mode 100644 index c56b77b77ee3..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_array_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_big_cat.py b/samples/client/petstore/python-asyncio/test/test_big_cat.py deleted file mode 100644 index be428433ad4f..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_big_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat import BigCat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCat(unittest.TestCase): - """BigCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCat(self): - """Test BigCat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat.BigCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_big_cat_all_of.py b/samples/client/petstore/python-asyncio/test/test_big_cat_all_of.py deleted file mode 100644 index c0e71dbfcde6..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_big_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat_all_of import BigCatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCatAllOf(unittest.TestCase): - """BigCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCatAllOf(self): - """Test BigCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat_all_of.BigCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_capitalization.py b/samples/client/petstore/python-asyncio/test/test_capitalization.py deleted file mode 100644 index 2ae7725b3f09..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_capitalization.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_cat.py b/samples/client/petstore/python-asyncio/test/test_cat.py deleted file mode 100644 index 5ebd7908d2db..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat.Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_cat_all_of.py b/samples/client/petstore/python-asyncio/test/test_cat_all_of.py deleted file mode 100644 index 531443380c6e..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_category.py b/samples/client/petstore/python-asyncio/test/test_category.py deleted file mode 100644 index 6a592521281e..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_category.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.category.Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_class_model.py b/samples/client/petstore/python-asyncio/test/test_class_model.py deleted file mode 100644 index 12b7fb99402e..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_class_model.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_client.py b/samples/client/petstore/python-asyncio/test/test_client.py deleted file mode 100644 index 9e18c4310d96..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.client.Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_dog.py b/samples/client/petstore/python-asyncio/test/test_dog.py deleted file mode 100644 index dc151f998ddd..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_dog.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog import Dog # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog.Dog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_dog_all_of.py b/samples/client/petstore/python-asyncio/test/test_dog_all_of.py deleted file mode 100644 index 3d79f2888c96..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_dog_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_arrays.py b/samples/client/petstore/python-asyncio/test/test_enum_arrays.py deleted file mode 100644 index be572508ef22..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_enum_arrays.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_class.py b/samples/client/petstore/python-asyncio/test/test_enum_class.py deleted file mode 100644 index 57eb14558a7d..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_enum_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_test.py b/samples/client/petstore/python-asyncio/test/test_enum_test.py deleted file mode 100644 index ecd43afc709d..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_enum_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_fake_api.py b/samples/client/petstore/python-asyncio/test/test_fake_api.py deleted file mode 100644 index fc2cbef35f1c..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_fake_api.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize - - """ - pass - - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize - - """ - pass - - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize - - """ - pass - - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index 87cac0b9ef85..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_file.py b/samples/client/petstore/python-asyncio/test/test_file.py deleted file mode 100644 index cc32edb7b523..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_file.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file.File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_file_schema_test_class.py b/samples/client/petstore/python-asyncio/test/test_file_schema_test_class.py deleted file mode 100644 index 91e1b6a1c745..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_file_schema_test_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_format_test.py b/samples/client/petstore/python-asyncio/test/test_format_test.py deleted file mode 100644 index 46707c77b708..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_format_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFormatTest(self): - """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py b/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py deleted file mode 100644 index 2dc052a328a0..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_list.py b/samples/client/petstore/python-asyncio/test/test_list.py deleted file mode 100644 index a538a6b1ad36..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.list.List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_map_test.py b/samples/client/petstore/python-asyncio/test/test_map_test.py deleted file mode 100644 index 0ba6481903e6..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_map_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMapTest(self): - """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 8893bdaf44ee..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_model200_response.py b/samples/client/petstore/python-asyncio/test/test_model200_response.py deleted file mode 100644 index fab761f4edba..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_model200_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_model_200_response.py b/samples/client/petstore/python-asyncio/test/test_model_200_response.py deleted file mode 100644 index 314ee5e3dde6..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_model_200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model_200_response import Model_200Response # noqa: E501 -from petstore_api.rest import ApiException - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Model_200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model_200_response.Model_200Response() # noqa: E501 - if include_optional : - return Model_200Response( - name = 56, - _class = '' - ) - else : - return Model_200Response( - ) - - def testModel_200Response(self): - """Test Model_200Response""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_model_return.py b/samples/client/petstore/python-asyncio/test/test_model_return.py deleted file mode 100644 index ae3f15ee6b83..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_model_return.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_name.py b/samples/client/petstore/python-asyncio/test/test_name.py deleted file mode 100644 index d6c72563991f..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.name.Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_number_only.py b/samples/client/petstore/python-asyncio/test/test_number_only.py deleted file mode 100644 index 7f6df65c8058..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_order.py b/samples/client/petstore/python-asyncio/test/test_order.py deleted file mode 100644 index 3e7d517d5c79..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_order.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.order.Order() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_composite.py b/samples/client/petstore/python-asyncio/test/test_outer_composite.py deleted file mode 100644 index dcb078cd2164..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_outer_composite.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_enum.py b/samples/client/petstore/python-asyncio/test/test_outer_enum.py deleted file mode 100644 index 472e36e16821..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_outer_enum.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnum(self): - """Test OuterEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_pet.py b/samples/client/petstore/python-asyncio/test/test_pet.py deleted file mode 100644 index bc5cc30fac0d..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_pet.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPet(self): - """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.pet.Pet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_pet_api.py b/samples/client/petstore/python-asyncio/test/test_pet_api.py deleted file mode 100644 index ffd3e25c4c64..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_pet_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_read_only_first.py b/samples/client/petstore/python-asyncio/test/test_read_only_first.py deleted file mode 100644 index 2b647b83fc89..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_read_only_first.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_special_model_name.py b/samples/client/petstore/python-asyncio/test/test_special_model_name.py deleted file mode 100644 index 4edfec164f7d..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_special_model_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_store_api.py b/samples/client/petstore/python-asyncio/test/test_store_api.py deleted file mode 100644 index 37bf771d13a6..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_store_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_tag.py b/samples/client/petstore/python-asyncio/test/test_tag.py deleted file mode 100644 index 2c3c5157e718..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.tag.Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_type_holder_default.py b/samples/client/petstore/python-asyncio/test/test_type_holder_default.py deleted file mode 100644 index 1a07afa68604..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_type_holder_default.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderDefault(unittest.TestCase): - """TypeHolderDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderDefault(self): - """Test TypeHolderDefault""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_default.TypeHolderDefault() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_type_holder_example.py b/samples/client/petstore/python-asyncio/test/test_type_holder_example.py deleted file mode 100644 index 7a2621494857..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_type_holder_example.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderExample(unittest.TestCase): - """TypeHolderExample unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderExample(self): - """Test TypeHolderExample""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_user.py b/samples/client/petstore/python-asyncio/test/test_user.py deleted file mode 100644 index ad9386b6908e..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_user.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.user.User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_user_api.py b/samples/client/petstore/python-asyncio/test/test_user_api.py deleted file mode 100644 index 6e8aed4f18c7..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_user_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_xml_item.py b/samples/client/petstore/python-asyncio/test/test_xml_item.py deleted file mode 100644 index 121f1ccb6623..000000000000 --- a/samples/client/petstore/python-asyncio/test/test_xml_item.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.xml_item import XmlItem # noqa: E501 -from petstore_api.rest import ApiException - - -class TestXmlItem(unittest.TestCase): - """XmlItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testXmlItem(self): - """Test XmlItem""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.xml_item.XmlItem() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-asyncio/test_python3.sh b/samples/client/petstore/python-asyncio/test_python3.sh deleted file mode 100755 index fc91ee7a6704..000000000000 --- a/samples/client/petstore/python-asyncio/test_python3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy --python python3 - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-asyncio/testfiles/foo.png b/samples/client/petstore/python-asyncio/testfiles/foo.png deleted file mode 100644 index a9b12cf5927ac757b054dd875ee137c2581f69bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z005plNklH1~87DdzFiA2XC;)~Dpo$3~298uzpt7UB?2C zrfPXaKqE40ylK3PysV@&`KFt0-oA3>N*fHwwj}%@A;B=D*V-^3rG!ZW76I^B9@-KC zfcx*if9)N2+};ZUfyS`GYGUP72QH^lJR<@ck#YP(vYDU1^7d=5z4ouR`v4F@Nabc& zLb)YG`lepJdcUe)d-l2K zyx+EMn+;9f>WF|wWYl=$JooJLs~>;-@g90(3kED$Fc@GP91I35VIa{AEG{nY zvw8F8{&{(Mcg&voQcL&x*|~mgF?k;cfR2d?c;u0XX7umh|K6qw9ud%pj2d_(Fkkrl z^Q#~K)3hGaAP9>gNm&_?3=;$k765@>@hSL4`-^bt>E}Z6H3S6PF%3arOT{xPiShm6 zaxDJ-3;f^iRX9|27?PB=Az0cLiU1Kio9=(PpI&~}St%btePp1vO#Y+2CJ+e36c-ow z&igcf^8ESphpk+>(vvzC9(RfzfDl4>fP?Mdh4VZjMxQ=?@Y-vywQ1HodVd5oBIA^^ zFc$o0{(`%wOdh5;vMIIOAz^?JV2PCI({a~1SD@c%=Q-O+LO>I}064#sRB;W90D~nC z1diaTZ~u!W`@d9i4~rm70kQ(H1R$V-r(^)1e){R~xW99MoJK8et3pD86hIgP!cuE2 zKw1>0Krj!2pkXD zN`p!8YmOYQIAhVG#V^j7F=NEeojV=tKz%-WTnrHe3^M%2asWp7z(xoa!_mMqWY}Q5 z@WOLZP03Y>fJS6gd+L6-_xm2_pMU;s6QUk=Pew6SD!BD)K3<5G%vs zW(dGyhG_$b*Vor%uQKZ(#&3EJo6C2BC`tuPL10!XU6PE15$%lxEZWaYWH42V~ z%W51sawPu46(2nC!V5DeuUfUr0|vqe6yahO!71WUOT=$!_^lEzkVw4#`s-7&`ex2( zDrwpXXhcR>5|ULVTV`ct9Vp(p8wN`N0u~s8C0H;7n|R>dff#&d5BszgAjyyhfye?| zYQuzl7P)~zA_7|h`vew{U=RzGR~^8_jq|YOz#g^Pm=O>vK0-vWq{Oh{Lr&;~mQtD< z3pb7U```aQck$xIA)8(O?s859!zQC~h}EG3!l5onD0uj-5)tzFj^gdjP1CGs3hPBg zwoGIYQNZul!~D%}esf^w&Yd8@zhMM{Nnl``R9w@x2ZZ*~*#ZkvR)Hm8k{Jw4%Ds_* z$;x%nd=55+a{@C-w2E$p7t_Yzyp|mh04W{_)JaW}5k&$^-dv1j%iet=9QcJBrKP3G zul;AAe59n;S34~t9~ zEFtZ)M?n3~5bAM~AwIo!RWy%-1cL(r1VNGnlYn7akOrf)GJxAQ&c()qdl3bxh+xv? zaY%!)Y15{}xVTn3!@D6c3)dBnm^yXpTpiH#S_q-mffd$D2+fFub3>?FYa?6$H8k5| zVdw7RsG0_FBcKr(jRr8Ps;XKhCwDra;|SXI(3ZxzE!tvE>Wye+Hiv+O1rubSqJm)u zHPtID5FKFRN=ia@b~e(|(~y#! zgcdDZf{1YF;32GDy&A8)@(<+Z=K6xDLb%4hBDVp{-p#q8d-v|IHFlM2|6Oo1IyP(V1Ssp;!)20KQ?e5i*8j_nrMUbJow|Mb<(Fq%ef3rM zT5Or~=FR)pZ>Rijgg5(9jZ0RIWf080a9^L4l!UCl*|_40ez>StFLdb8p~m0ir8%$Q zfj>@lVkTY?)1R4<(Hn~vzd;fAq?Uk#nayq6wq3mR?VM-+^rt`d(B|T?qTEA=4n?=L z)U~~O^_r8GmiA_ReC&>s1*}um%GkDT$Hm#1SsxoP5CB6EIjm121AjelIQpJ`E+7mD zutOKG+iO#F^S^BSFXrzoK!AkJ>|)2lVP;I6I1#gE&GN(&T+j=(7*K6MGI;%DW@h4+ zTW-e1mt2gvxY(2WE+a>b#;2ctis0;tdmR#+wros{i;LSC0gdAX4c|s)m|MTy*6;f3 zuYb3=xHtqLye40GlQMK63>h*6Lx&EX(Y0&Ww-b{S@(jZWoNDFEHJ^Bx_Q8kD-kDWJ zMQXhoAV&{_h;i}hoiU@!wTgd1isBhulvWqRkN^vbl0X&4teb;f6+bH1#dc4ES)=Nn zxhJ`l0hO7N(#_Z~g#`-zGc7F*lP6EY)%~xA5ViLmD=VweDdns%*I+}K0G@pEi8pV! zam?^Y%Jl@nLrQ7Re{I3sDO0A52uGChnvT_59De$4xZqS`Vj_O^t6#0XX2{@QCnY7U zG7O^vKb65S8C;c@SAY@Mj)Y0-gbuI-3;>c4XT;#0UgOcqXaxg=Dg+>4_}HFxJ_KQP z$u>;b@NeiWiw3UHf;aNT4lK*EfdeoM!}(jE^hAWDq$CU)GzjG3o9p zm^W{p&l>W&DoII6$X}Tk6^UsaCt&E**~1S$R6cw5oEUdv4IigJ=(W}OtRmqCJCGW%pz6&LRUNwtwIgJ4){{-&Nc2*b}z zM*!rcO9O@kaouO^m3yRsKrk@*s|EPryUk!hFkslOQ>gV2?1F@&cmqIob|$7x`xCl! z?OZR@U0GR)PAO*xU9@#n@B(vg8SW4%UnK3K<2K0_Q%PAOROTvIr z=K)aX8ttMsB7(&X3Bp6)yp5%M*MkN7;uqfHF@MZU-RIV=TVu+UDY*HTn;dthA;y+1 zU*WP#`*|ql{+P^=Aw%%O%;y_z7NyapT$$M%KK#0>mHDfJHoOcIyC5gJUcH8aKy}|S zT$N(@*h#3_n~{-$M<0FkhOVhy-aJ|$wJ`%mWo2c{yYHM-viPkfh^it~MiC54Sz{Im zL))d{(Q}5O3IUjGC}yZ&+sZKNOs=Axs0DCkz+^(1aj)pPvAZ~a)8lHsA7pI zC>Mi+NMKrjLogtSA&Fr~VFLo8W3xC6I`e$I_5C{KMhSwDminon0|ZsJf9tPr!yoRu zuU;}e$20o(?~i%&<~cs1TgRf-;J$tPQroo)FRmQ1G~j0=rX+Pb;GXnWSnEJ9?vW!$ z;?~TPKKR}5?wOLAo%Od9(Q=SdngNFEl8!k%lY-#Iv!Rzzy%FfRI zTLd(Yv2h-L@R0*EXU=RH4m8v$ul^n|U;tit@wpRP5S5jc`2346F?a53$on)GMMXtn z!5|#ZBm71TP3a~kCSua0NpFrCHR>0_q$5NWkW!jL2pPdY=Q(z4S26oO!(gmt6^ z3BZ5?UP%Bf2{sk5=!}U1#eg%{x^D^~F|Kef)|72iKxw}}vy$~%yQvVZ1U?b+UHhQ zR^q*P-^UwoEJ99BPDort|6LsyAUI|c3?NU({Rzv3&XR zX|rd~j`3O!p#bDh$5pTCV1xy3H|OWp#QTo40(0 z7oUF-IXO8fD=Tw0qBmx8H2no{;I{h0C?l-35Z;~e6WBsCMFK|?wylYKB3L+?2quZ& zcKSJf(XNj}A3r%u(jyj31h7DrZE5JaGoa|`OwzFylq;gZK}b_oz}oL&*_s>z2Kudf z8l`~>pExlDAuB5juP>b6s6k`eV~^vxXP@(}3&;9n#@6lIS~qJJRT=?}Fr%WPGXCsN zXO#r&E^3!VFS<>eH=Z>A|9D1Tem-W;d9SD^q0BN7_04_Q0T*R5pR2fw*00xr;Sh*rE?D!uR?EVa8 z)*%FlVY1=0JqQSi1A#;Mc>h=U=*O=yWBY$`ea8!MTgOY$(uh$ed_cLbV2RSe0en)j z6(8^W1||~%WI-CLX%n*mguwI9zvuyVMtpocva+%;e&Tp!^y$;!>DRM5b*g49DB#$< zdGj@m5i}ay(vVV`NeRhS-XKu0sTLa>i;bHK8%5e|_ny7@;~)NrWy_ZNz%5j(L4*WS zL*10>>CeX^r-jR&c*SCBYISH9sQ&$-^M+zj+f)#Hee9FW6dc@zsoyNc*N65w!A?(~ zM%6ckExVngzjQoSMB}Nh*CC@-3Ic}2t|R4`wfz%(T(TJ@fl845dTpJm=1r`$JQzXU z>izROYSbwF`7e*7S;J*m_9t{qIm1gP^isUT>73s3*kaOM4>0=!4h z=4kgwAR{Bg7gQvMPYfm)q?xPmPS4+v4R;7W?j(Cg63}RTUh!$H8?Zw1( zb5Uj;h5-|j7$ohWD+E{qAl0Ew3PV{6f&eQ37^+9CfQet9bt$$V*pD~9UkhP#OQbL$ zZ7R72IX}osUs_xTO9O`L0;d6U^ytx;KI5r6u{@-d*t>6^Q`o1oJTWbr?>|ye@kY-J zdX4v5hgzA;0wXCY2?eWi=_d&q!NB4D{kDm>^O7Y?>-EX!50Cwi$*nv=`wk7OChYZbh;9P z1p;I_>fc9QK=uYEX0V6`qYA`8nRNtXzIYjXj+B5{C@^3NDHzO3do*B3m{PTIguPMJ zdszSrFqx`tqivb!ir3(5QWOc5m9dX=gO!CAAj^rH=rVq3GhBtGl+&GlB(~LY>m9e_ zfj|D?m{#WUci+RJMQ9~`M$?V>Pi+c5TL5&Dx1wcf2vfBt;cKUf>CPnZj zvqpLudNUg!SRw$TC`|wQUHoU?Drb{ww@uZO7zh9u+O`|o$DEGDW^veAQHGsI%J9+t zEjVNyR)-3!7LFDPz&@ds-iHN2ges8J;viVo&o86kj|sWu_Uu>z(grRAgv`u7nE%Fn zA7EBiR^rL0ren#QOHfo)6iU7$Wx*)RMpfi0H_dS7NPrL^d!C%Wx2`ToxIQqFB!&zb zf~WubOzUtm4X0%GB=}2ufB*QyPwop2;CWBx)YQ}_1sM9;$B(-OWXxEqy1)o@d+YVTK`8cB6O8B(*45H8!eQ<-2k> zB!DPpSdy^&NGblaZ?&y94oGR)B`XACfeT}k@Zfm^(6L!-0K$oZ2uPH4x(rWmU4bQg z*8!%0B?++O5rPZ^m|++utbhe!5L$_5xb%#3aph^}qD#y6Xd4r+tP3d}>txfx-PnA1 zFV>W9$A5qP1_!MQ8)(Q0oT{h~BLIQ?+yYFR@>@JT{YhDnzfwH))O6(K^GZiTI6c9onE~+K&Nx1|=&+Ji+bg<3u(5EA->njZ$!qR<(n6)b(rBw$YSU?b? z5)x4mkR+5u094hir0N;FN^?X4LN&# zJ9gM{09)8bS|CFpwM9D++nEcNFvC#Yt2=inAR)+Y)V$@;UNp1QtChrvvfpQ7LKb4p zSk?3h5{C3!GJB5vh=;#^4~zgz))@r_0FoqHi{|*_c>{698C{g#CkPA+mI1qb-ph^w zBnT!HxlB>gl~}SA2I8Yy;GRyGq2C$Fn6mLLlv#&7@ew=bAq>D)izAzXs@5_fgq^M? z!<`C?%Pn1P);cVg0{N#8&JV#76!t~byK{(|e*ufNXCD8Lrf(I{>qHN9J8 zhu3xxbk}Z=UWS0Q{cRB-ToB(0x(-FxdDJA8tN0bFbs|Gz^^e6$K9K@SB8LIX=5X|B zmF%PyEwH1@!K5sLsb9a1vOp;Wn=0iB3&PHR#G5VfV%iPp+@d`s08=n5Ettfx30|S< zpfX7OLjePvu5cH{or78FH{!PS|G^LPAcP>rJMmOiyG^5%Yorgi#OT(zF#at3tj*cz z(d`J<8RBho9k&4l%9KA*QwcSBfG9CaCM&b)*b$eOHLrcCSK-JOopcotgzK zm0rT)#c$#FzyJNk$!8^hLa6_~J`G}NFtfRN^X4I5p1of|TA+Xb{*hf?%cHEU+@4>h z$W3;e!+;Q*nU527_i?((k4yaO&$w_lp;>sTZ0R-5BX#rA52qxTp_uVTRsfheTBnk<>;I79+~mz%bZmrIPD*SVFlS0Vy%3C{Ky< zDAa;9Y*|4DZcoU@g|TNTp=kT`H`%DA4WRbjd96BP(%JpgBc2qffQ0~Aut?yk&cm?y zqT4a~tSfPDtM)bl&O|^8r9%SOa$=G-`+U!R(4x)Egf7k7;pr~J5N9?AJZWK_y3Q|H zh0@Z}WbeK@GQ8QvBJ;Z&yd&1&DiePox{@{rPU=Gl2n7--)t7EvVZU?OVln&?ws z_ev2$C`}8tocFLu*y>smTMv8(iy4MZt`Z;!0AC&c4*BIfRCd8oj9_6Yle}}Q_86O- zrQ#))1vZ3gG;I^MYGVsn%wRGwNOzx;PF1oBnCjFpv(iJY!TwMTR@PP@1JV`C9(G0=;-X^QEDhYO*5Wr7 zPyR``Cjej=M)&GYvJ=sSh>V(zwQJXg5a8{i{XoNGHDh^ll31xcTLjL(CGL5{{0sOTNGXwB{J$Q&g8fxY;zcN@stGD7>EecF6kyP0oRIC+rsfypCqyYnjO^0@2Lg4}wA1Q;yjMYCDIq?8V02_*_N`i64Y3Hf72c$Nwu+4a_ z049xE5DAh2dy^{g6AWB-+PR2}ic#rj2@r(+{TQ1M?SZgm1^@|*$suP2q?^hOw%n=( zEs}~!YlBCnDQ)m2N3FfN8Dn?pRv=`s(m}Od{rKYv4b;Xk>v@p|Y(#G3i(iwfgNt}p ztHdU{#ka1<<14KGlDoSGG7 zS?I4O06-ABv}kA7_^bCM7`A07K}6Q^Souv3G&K4drV+<>!BDtpeI%w)HzPSY8M(Q+ zHYHgH;grG^NZA%{Nw+OVQG?nO!NS(FumhNaFs5BktoUIwzCQH5;&NCLWT=x{2SWe% z{Wl)vE%lfo0Tu$Co1fv4RIFQT3jl;=yJVIU0lMI{WUMaVsld=uaTI0?#g#u|){g%v znM5cO*m=#{;>N^Y7;;8;FruNFGgyjFev-z#rmI^*2|*eRB>^A^hSf0ZNYp1-c+jua z(Ha0<*z3Z`4zGjJty@=h(}nQ4CnbDD#TYEL7^N1>sbQcoKyHNtCp+I*^E?777pp5^TbwyCJ|r zxk?5M2x;NlLwoSZ=A{_3_El^-xZ84?LQ_#2Pk}Bi z+hbPx4QL@uuyF5j6#*azh5%c3z*6%! zoblj#3%2Rr+$rak6e za0@y&Z|l5Y6a(OZ!@Pv0$Xd!haLIo4(b-*-u!1v6jzpi0U{dHtO?J6HNq{6wsLgA@ zKmdf&z#&ZBFdv%_?gr@OgDym@=;L5Sk&3Taw%4eLaAegd8?-?{gNOpsk^x6Zl_-SZ zrJ0M7QM;pk`}U#2#ZoaGzdf)|=|Ttrk`@GN$hfoxdUgNRfNh;b!`*=Go1KP#pFb84 zpECsQo5!OH0RYO(Hv+2rnldcd(aSXL3`w1@N9i731_`^W7T6jnRW&6x<5Nh>(HfOd zO`l-PA_7vyZCI(2l~*0aL*Fc|oj5J&Iu`ZQgeL|h3DMEf2kN`pwL!>T3_cvJqv34` zw0!xyksV$~LBFJ=BwqkfX>tmD@WWnR=oqlAhv94nl1ihrKC)=Gh>nW61ng{)!2XI7NV{1z zNrq+E!-@zv6`;l ztXZ>zr+gq309v$YQ4-EK)+sMm7Nu1ciZ4KnDo90XK9o!~vmw;$#AixF)CM<$e!}C(n zC$+hM9Kj?hQ~=vH(D?ZHZ@oU7TXSN9nNVC@97(&@(YW>YTcHJxwaS$= z)M+|z?8oXN=bf;o^c%bA z&nDm5KtEx^Efq)GXQxykl!(6Zo^(3sr8FMYqT91)Ph^MJ!RXTYJjBPxyRi+DYGVt= ze|E3NkAXvq)MXb)DIeY|qo+(}#msb1YRzaA?AZ)<^%d&=8L!toyBS1ujdeVY>km}!;Eq^bv!|P~_88gP=MUdUP&|-;l zs{#*y^RCj?ly;YQNY%y6(D%!7^f*<4l}jJDgd5lWx>?OY?w~AM~fuS-MtzXEEpgJK(K^#dc*XNO?IBg zLc)+htZ0s2t&&tr0&;_^78vUf@3uKCyyN??@s>wG{c31!wn?5-$-H*ug_Fm&qF z>623)G(4u$hK!7iYJ+tEF!$g8iR|t=8u$MGcfN%yp~P}XTKMFLukg-yg-Rd?0+vnf z*PID5ge#B>Hz)@H7ORZ~OFA1tse&tT@q&<|OsjwI5tj%9q$t$V_Sa$IgOaaME)OX% zl6EUa-K*9xo$B0^wlqiuG)XcJScmZ84_`T13xln2&skei3^r^%4Uhf|133HKbKXB?LBkuI zv41ZdHELv4aG=Kv9EF92kTMe2sEZLD9fezOz16Yw45@eIf5iww{E@tlm(5DW=TXv zS=m_|l__g@OfPoa6=p`x(wxW+ucPtDseeFR>v%AP6CW^jX_&C^(B>Tc->%h)k6)j$NRrhKurGcoSc}1 zW>L`xPf5_IE(Mg7l=y}hAp8U`wO}53r1OjQa-sM z1(+C5Z~ZUEZFmi<4r~K)mCB$9R^?da61sGSsJ1X5RnwqK!78gF2~~!~rbD|hyXX^) zUjGl=_~k43&+a^w1rFNl#I0ntOnXh(r|N@WFU6KayCJ0I$OjrMYb_;fFmS*+gehAV z+106v=&Iv2BrQx#xfl|*FpsU`t~c<1cCSJ4ky1sB3rJYPRY&g~mtwmb9MHGJKLTKhDy%O578BRa#rTa2 z@YZ+hvFmUtm;_8q!09gUQ5I)bje)8l@zsIv@y>Va@aR|XVEC#RasAp?@j~&(*m7VG zED#K7!pX{z0l~uQccOGc0}w1wW*x$W4X-Snh!Btx1_5hIcH*gRE0nSrTaZzJuv7+x7`XKGb9^1s*e>f= zfFpdsr-R3enJV$|_uqnT?u&X)m)<{U@HM~Y2B=b3*V%x4h+A*Hm6yEvPSB%nO9N&? zQc?n@PW>Z(``h24w6xUs%-e3e4O1VuKeGEza@>8_WGq;)z|&rleLlAiIRUN|D2fs&&JdAG+d{=G3Tewz)%Cx7Dbzs0ifGijiXl1s* ztaRP`L`eWj4P4Svly7!Bx9fO=fJBu5qAfU5e6X#huMh3ULtEalc_D1OW3VeqZJ}Ql z00_O~k};q|8WN)7Q7RAPlkdL8;_ugjpF=t5*+TKIq9`H6soBf*XpL$M^7EHmJAA}oM{L$UVcZm~ON8;N zmTTdj#Kc4ttjvq-`dS#1?w*2q^X54l%Axo}k%@GNbxE#}kA990_7N-B!jMYy!L&=w zz4tRX;LWa>jIZUPPE+a*>tM?cvKp9@aw%?1=mVBf@DZh0cdl0(%LKWg0yiE&cI;s8 z&NZ01^AnU=6*f;qHGZ@N04o3~44X)$;w|p=s`ilTx)=r+0b;wKn?w{dm<1O1o`8g? z(~q$~EG1`10?|^U%2ZjRHKp4yzHlzI9FKRd{_uxCto`+!cbwl)Yo)>56971`bLWQ@ zAOynud$uN`w>Cw`JD3^C$;px3UQ6TYXQpHJ>{-xq`dVGvwAqaem1;FWcE3~gJk=yw zJzw`KVOB8>uiF{ydU`j3e%|QOqp@Pee=%s#Ap4MDSg5j1c-8aNf`u7dS76lVuVQuC zw+>@e0gvjJBBVO;Ez&(*0n1_#RCoI?%8D>?{l76|$Ga%w!wzU!Hd~e10-M4COQqi_ zz-)jh%I-p^tQ!M1<(`$$ux|1^>8yUo1PmQq_O?`_fC9A_Jrr~=paQ@(Lk9o4LE~W! z;ht#ggPF~Q4vAGlxQb5xQ^y4ejkubb$82HNteLoG@SwQF`tnBPl5fQ>XqBgRU9qi*NP6dLY)VQ)yq#NY$>B zCU;o^NQgcIV>{gJ{p}T9v zbSM2R6h&TGD#h$|wbXhIIIS0>U?RW)J4h+e|IBnedhS36T#n_Q=<{3Hm8@&Zw`1J; z|MQ*g`ZJS~l90bLFG}y9hUn*7FQ5_b%jw6S|N9H;{`99mrF-2D*Yx$|{e6|N0i>j) zATR&Zh@NO2jr_a<+;!L8o;n~;I|Ar>38gXW^eh!>GwbxN-Obh0(Mt{L z@A^%({cV^TS6?*%8`f=r6sj~`7iqIcCjW2}aqJH+{c9=o| zfp()n288WyX|6;SDglZ@TJ!ek5EF-we)tN2RIUfRaW+6vx&^t}4gqBqkLi$sdpcd| znhnROA5-9^0-uHys4^rbuA7V1<=YU&Y7Sj@knz-0PrZ4=jn@x9mg|2?#WaHd-nw;r zzn^9IU7`NX&({d{pp?I>2rjEve}?uQ+C_GE9gp3+_uz@YJc;Ew%j`h3@b}%drSddO zk^))*Ov}*;#KyKn-@bh@?Al?t?9xjR8yj2GwS&o%euvjyd(AfEEmt(h7Vxp`^d!iz z;|pq|McFMP?MhG;oU|)dO}j;;zHXBZ#Zom0y<4W>$!^yo)@+6ke)tMcZhH^kR~%6F zF0kD$Nw5sJBG&>VG5R!2I_GlqYkjU#?UEMYp^qOera^YIX;TQS*uMpnHoxJxJp%q7 z$J>jxH8%_+&`=%Y>lHMr0}p046FVkVc~3L9B9QEp%JKons8OTv^fS{VJG$OomvU?< z+<^Q~^H5k=h#$*J9bSeqpH%>}`vvEtWs4RVG-x2sKC2U=qoYsibLYJD3jXrclQ>j* zP!)pNG-`&WHax)>AJH2*N_BFwCHgE!Do+#8ba9xnBm{0tz8K>YG7!bls3eIfsD85_ zezzGP{`eI>E8l@#6(!DL7Hc*`ued~9envM8XqyH@3K*oi+1m{fj``iBt;Noyqyq-8 znS_wH|Ni&q*E~M$v7TN_!;NM5M_gPS zHf}16xFtWaaip>mH{S3I^9}sp1&wy=U#r#q1p) zD`qS!>O4GPSX^A(T$ohR(D$O=Y2@MlzUG>NcLi6v`T;{YLD9u;y%_wI8K|tR#JkJi!{7e)EY`1I z?@LU5bx>8`7w@G(Lb^MpJETFnk#3NdM!G>jx}>BVq`Mm_K{};FIt8TRZN9(vW}g2! zbBA;9Is5Fr)~A+y=vUndDj^{fK-#>1B?WC92zuyE5g~g`aS7_gTK)jYQBG-L-8+VU zT{xY5m{H@lOGA8yIn&bQ#I#ygNeI?lXDI8>NV~j@5va-JsY)S%@43tIQdrYxPkQ9! zrtcFHUbl%+5kTVy{Ft*_qvYpjs5PbRBg2b}>hS(&ygy|gH`Tk^aevm2XOtryOB#4{ zvp@#K4^cqJZCURyk0ufPva{OTv$*tpvmdq!V!HxH2gjXTHX#M=OtcD2xmT)kZO72z zrfxZE>}1HHCT}Xkn0*R}=-D|fPVcZ;Pi}@xH5ge?h-i&3q}+~I3E;%nt?s{fN_9BR z_vsMcjdXPyZ*8aLRLiUO!@|$iym3wTeez}JQkr)0lmkG=|A5P75``qD%M2jS?_D)+4Ltn-%%yzK) zvuHxbm>twYD^=W^GX7wjP7fr6Qna>FHCZ0lHI~ID?_LYwH=Eq#CG3YUnHRORS$c_{IkVtj&3X;W!{-|KO9L8#3SF^o$1N$wkRq*um zL@XS1U@BO5O?~QTYQfB3mF4B%S!ha`B}q$Fv~ej5-dZMo=TujCCnrkyGst7NO}xF~ zS{}#0I$h-O1D`Apb0>T>1a3()e8oyubW@sT(C%>8bfm{14n4yC1J?9VQO6;?>?({4 zAR`(5Fmo`*S|?&Vu2;RMmm{S7r>T#5I_}2(B{V(EW`^;7esK?tJrSVjz(vBMl>Ek$ zEfxCHXY|Kdb5c&*EySifo>yJSWP#sJ{oQYxQ%vYM_@AX{05|us6|5iOF;xE^yc2|| zr$&{!Ff^*&;!N|R6J4K^`n+#l9g-RqRo>U%FW_^Iyr9odDc)4C-u}G$cjzD{svatvZ_6Cb}FJs!bMv(djb; zrn9T~abG!JgM`4<4r#0JwFu&dC*N<<>a&0DA70_4nkEg47RoIx1mqWIO? zvKk+|jo&}YBSHyw?V2uEKWQ8Z{>?w2p@Lh_#YSh}+%k<%T~O5_e;=xkg<%35LVPNI z)g+v}h{iMNg%~l*+&+5^`YP271*Nk*2NSKXHnt1R!nLJT`G!(rJq-E+54x{ehbk;F z+-xZzfw`7$gQ+nc6D^W@dPKAKX?Aekp_BnF9Y*-_ovc5~kF#@{|4KvT!pkEFLRIup ztZn=NJhU~^kWIzF@M@*CD7U?RS*?5jPgJ+ozSqw-IzqO8$M?bwySI4QrLyr^>DzNz z3eB#Rq(1Ah@w3DPsL;eQ^kbExuQPgO16eBg*K4Q8#7;HoEW0tFr(kOsS=NX#|Z*Hnzoo1vM_RM@&^Nk5WcjQNh7M&a; z`Gwk7!bbyGJKh(C<+JnedTXKfb7b=vf*9o{CpD7>U1VT=b>&|5J?*l2UaPV{*r<)y zfn&5wrd|AVIhFjN_Gq*ms;Y|?UvO|PF3w-2rC5CoKUSW&dF-AXtPXv>pBcWn zY0!BS!BD57x4&||M)WN!tF@Y9r)0I3jz6mh<)UVg^l+mCR;xgAAGx5YND4y5L1?Cb zb-}2~?6Y;%Hgl&&jMlKi+<#;Sqo5iSS8XzKFKe>Up&N|V46E_Bm25Qm_X7{2L?C;~ zGla>Xm#*BU`{sNrhlX-Sm?P&q5`^vQNrc6!z-yum^iZ>$wtZQ&;c?R*p)QnHGYe z`sVm(>SLn&KGhj@XQWta%IgyI`q?%h&|y%Bh>*Sb6^faxtQY~}JuZBI6lARN(IJ>m zSeVrJ?lOjHWyq=|9&O!SJgjWh!xu{U!3qu&3oDaP8b?QNE2EG~T%YC$SKdu1eCi0@ z4ZH8Fa8lIMV^uHSVORIMP37A;ibyD!N;kjPmBX0g>)-`>=%Xi?K8q10NB^3U>deK_c2^3e-R8zz zKNoc}QG#T$W`AGms-U2-Pj6$r%yaH$SZgMW4`pI*{bOL@!}Jbnd=deHq6Hi0zoW%` z#n+H-g5vC$y}i8#NEY;D*Ad+lL3hXC{gXr26&kHl`>Y>wQ*8N@_ZVZH1-Pv7PkIDG z{-XE=_V04Jh1MeWx9I$vX%YkUJZ{h)uo89M?a-oKSPKF&d#PrF?4#sOq(ehLf8hKf9d{!dWUqa^zFS;>~dhihu9H8e<0F(%r#t(MBPs+s!~~ zt@{Q{W_7L=vAGJ6AV8>3wBffnA@j+?!a~A|jzekIX>Pc^c|Jslq}p+dfJJcw=z&{V zm&H~Jn4`gCR#Q<~-?M<#Ba{dZgh7x>)&$3GD!>V&FE3r_8i;IjyY3FkgnD%dT+Quf zV64JKRaI3rtFwy)Vh&kF947*X4#J{_N-Xr97ip$u$244AnP=4W^`jype%=@}=2wq;B zTIT10EQ2<0hD%QIQHDqFd$eOpMoJFKE&P1t?A5l*jYH;`=~&);G$^Logbg>$@uR@q(uLuCjG&H ziUvQ6&|Z^5*F&Jvvkemy!`a#SgP`VvER>Y1<}1$h1~kGRvZ5{-$1^D^GhllLR(U~P zaO2)irM`zJwnnm$0>AFB@ULtXqzkiuwyv5He(iI5wB zTnuAmU~ty=*7zb$x*pej(t22gHF@c{5s-hRvvvVgiJ^^lOPU#;JKywJT8^d$+uV*H zfGuW5tl~m%*NYH|BtZwkzC9<`e=Orxu#!OVO)c@u?c-ozWOO<`J?R6&?I50(rc5gF znZA!66Mai+iz12cZ1%l3pTE+rWfGE+b>)wV0+ay=zhhQf3mjh0qZ&TzceFxC_}#)@ zo-hgmdFdH2S{om?x(<#1>btu-%ww%@H>8$Af51GVNOD!RG{iw{LrvI$y& z#5r+~+oVGWYwhW4HZld()&`W9-7uSkK^sj}gigE-LZjuAa&f9->UsgX% z!A7`ZNpxvC2NWhQ!XV=Uo`VXM$_>-)7SdbwUAX4hJ_H735ur!tx@1vu+lbJx@_YkZ ziSLXYerfEHa#780T;1^c(I~!~$cPlivPhJQsvdFMyMb5^7s9@PyVCCh5F(-yav2ncidrss8az>N^_=qCzp$vh1m-7Z0> zs>vLV@xrr(M6!&TM5zDK+Vf|UGB#pH5O8zu{zc1Eqp%7&~kx z6b0DgDcIRDzJFg~^EflEw^_p#a6e(___I@Ue&8C41*^dl=@lzY>S-qB6~qxHuMjRSF5WDT-))xH34|O| zzJ`Q{BejwG-E2rpMd7m>An-y8rV%Hs~%9IH{PKaaO!9MYDxFC?vk>df$gf z1w{Bl#L){-0#INQH2xJ7C4UC+vG}V%(~d?Zg52kaU6D2ZxeI#&0o+){ba?b!08oTQ zMn;zZ9V$suH8hOLHuB_lJ6hPlp93y$WZZyn7{EWLW#~%)3?GUEQ`NkjVZpIG6@GUW z;ahM~j!whXIjYlin%6xqj&hNQv%a_9|BenjeGeNWdF_6?{F*A1H+4H%4qsob*s$6j z`LsItH{)99x#({%xU2uIrB~wkGK$KQx*r)fH$M|UZhmBRurFhtG z$Yu+RK7`Cr8qa0t+eT0Nc8M*O16eEH=Z8km@F3(um>l?t z`(|M(dyTR@@>Z+pIeOdLU$OmkEC-eRR;x`_-+*F>V$aXQ-rnBajfHdx==Zu-(?!3M zTRRcIetQQoUCZhank&EEEb5QMQ~s~qh-vG>mnw6--NGXN=XzIc&$^2vg{lQtrUWNh zLjx@*KT_lP1kGgBNle6BUe)9=^nVLzA&bg;2k;b9pMOI$jeFt&lQ{=R9S5aA6VzbA z@b$W=j;G>^6`Ooihq)jwQ^x#4mu{5%crasZRcut@Rst+EhsDMN+;bYc=|C6|p?WdF zU~G%jj0cf_FcOR2`Q9dJT@?G8>>;Et-=d^2@AhUC@>O&{mS&;Oos7S}>i&0{0F=g6>oepd& zt|%#j6Zh1@!fw)z<#~-?AORJ6P1o|Wa>9b1f44C}q{%;8x(3<;<|`Gs1^Y z?X%L_Kv<8q+&X15HTiM5-CW)bfwx<`*^wf382)yPf*P60=*iyn+3Prn+3j={l$_-$ zk!ZBZVL;2}7bOVA_)GZM`t*pfUih|-ki;k- zMEwAjBL!~a^Ig)a7#m;bS+9cN1vrUWDtE!_Y`+FGf~Q@D%bLqv4P`^4qdvmI z!hV*(B<*q1|(hL)D}4Ff|E9I{!n zZeZy)EQlt;z^^`O|*m}I$Adn#WeHY_^f7)rKYk1+gK5!!nTvEnmVT(lfi-Jw(id;=lHUUni+pq;uvTV8G%iKWb5uj z^6Adb_Vx>AMzj)L8s4z3C|0(XJ|-@RBW+`@lawk9NuHaK?!pGO~Wqr z5Lx$l&p#hc>~sO7JUh_1y$zfb?QsJhA7?Mkrt_-&Ja1(v4Et6%tzo1TnNV?Vl$Dh1 zs}ETi8G*OPtM8XYsg0JLAxa;c-8%W;@hj;N?S_vyp|8oFv>^VopV(iHV~4fQJe&DS zhvI^Q?M&dvKIH{Bm6}D^4G(b;4nIKgFDN^7?mxlxcD{C#2#3jF^@&e;VP3>b7!$$K(?H`SV+4me+`m z{qF0xF=yIsy7KD$K4nd-UI?R_C>YVkI~c2dEL2o5`BKqdoSXuO4sLI9ExZVOl*=n) zP5DGhXt6-kYw#OHVOe6jg}(3XIMGq7 zbTn}wFvRx}#i1J2icvg7oyl!7@SV6{4Dc~@Mfe;YUbxbNS6JF_;x$a_Jos2)n1&}`V**$a`7 zkW`K)&i1RjgzlMMymHY8JJE#P&=gfh&8~S08cgb(cDouy zxyfpo5KV%Ic%#5)Un_KUsrsh?G;j$Cw(p6QvcTj$s8)fe-bgjml^ZN({A-#XgH5|b z7#3tfsw?$4Vd_XL0R_M44hc!N+Sg!dfi4Fm-gs1Z325@=7O6*gHE_M;`?$#o9|klH$*12l z>kCEg1DQR!aA4mi z4`mK?c=HR>qA*VuHaVcWEQ@CUju1LEE-@p_|7lHR0=#q>{w0;@owb;jg&D__S@E4{ z=K&IihO2+*flEcjhy?9>Cz4E)VtZyoa1J!`K6@K>MCHwT*WT|2dA3&{##cKQYJ3Ie zD)kU3dvgL|K+Ezt=eE6zvks8-K|Gr-SO|bZ!RbkqFBM~joj1shuelMbI3L^muN4lI zPdteDY~;po#ooOOM5KnUhBAa^qb5g!hfRf%`v-|qosW$fg3L_bOy|dL-0o(-c9PbQ z!7^QnIj+ddi~2lhbE`Et$Zz4Fcn6DW!Gru)bJg#-Vg6|r^^LArpd|A7`MHduqN|dv z!-h6nE={d*tbiNE`01qDn@HL2I0!6-Xatt%QEVw=XW8X4BlH5~9kc>@F4K=mUVXBb z*RE_FcV=SW_v5!>Jdo#3+Mcg%{4df4#zcM(h|I0^#BwuS!$Lr@`cig(Q&P3a&Lca7)M<_(IA1V>EGFE$ff7cV0w|v-270>C>ZEg)f{(s zAK6eg{kzewEw`vr)~=b2TdpO`_S*U}LsWF&;ZS2%bXan1z4HwkbwC)oc2HrkS1U#+ zhfOYRD^h$e2la(f`tBZ^40JbU5Murp(t)T!{{TDD0AonGDFH4^=N=nr=PAVSP8wP8 zOd=y<7ZIzPSyFVp$Y?d#eN7Md+nz2VIBG@I*A2wwH0sQ|1I*j#2?z+R0CWfMeL91P z_>pRdLJ6CVi>RJ9pvG<~Ch|Z2m70c{^ywn|dAaY{oig?}o+RFK350m@Ks)*3_Y2Cp zqnJ+FA@z~3ey=j+M;|)A&?UKrg4)R|EKvnxlfdKYU;Fw)!8N=j-A2Wakgs{<1%K+G zL1`QN^XJbYiFwR!oA0s?w{6#}iXab0>YaYNj+)sk_*hdNQoSbo(`%3hAaZe2Kj`HV zNZ#zSTrr2dh9`;XBTfYbC%^-LI;f%bEC`J|_*S#Zki_hlEI!lOI@!;}ih-$Q9_l!= zLBFpkh)^=g=&(`5hT*XyjDv@fX-j{S?HjG0pB}GBGlX#lPfs6VmM=StlfICntA{@% zX&E^A=fg&)rE!nizIb!~`@Z|cbr;ULOg4ciaq@CA{xbsu0bLph42KvshTAqd1Y zjWQYzb~*$a9$@YFHge6PjDh`Comk$!PE2e|dvdNeVQQOzGiy=sWe0zRGpLRueMC_< zR=Z|Bhfzc90zwfOWTR{{9oYuH_6wqb?_1L4tYEBE(t_XVP>nM=>t&rfUJp{<>SD;xP5-7Mpt?q2hi-0-@wlvuF_Q_w#4;0wy0tZ~#ve6-dV%IQ-3Q=(kco&-(AD_tg9$0Z8YPl}fS zG5OjO{L!3Z2%-b~f!tr?lQ#KU$IO>^W*IjN9p149hXrWMDvGG#Kndl-FYxDcn))~1 z5^v10pF<-fZ5KP~4q3#u{BUh}PcbU10mUCXJnB2&w6xq}1g`25rszA@oRUI8!y|q@ ziR>F0e+&qYaif)xlf;07dB0HMV!)>TPmFWaqY(~d0+1rJv#{`Bj`RHl2^@W2$b5o9 z{K;#Jf$qRZC#iJKjD?KED5JG=BGH570?jy_O0>2A;1@-4cvo(vh~o40&#y^6tmhb+ zJAN=#86E!7Enywr1K=qLJ$kfwDYQXQ53S%?H`UkJIlPcXaW5|~>Le`zQ`dQx?;Sr! zUh{uq(hfR47(e_%(*3K8Kj38LsNoF~xtqjON(b3zb4Fd0r}Rk`zX&}SL`baQUzL39 zFnbgbVD{;(n~d!8k`I>xp+NUSN~OR4?3md?3gFRUAAX)EExVn&6+cWZ>T2^Co`Cf5ZdJf!RWwsK4in^({owwL zAgQ@F9Q}>V=Z3%Q|T^Rx36Gpu%X6X;IAsFcI&owqT zq^@&CnE;Ra0;=9(dk&imk|e8NZQS!`I5R=`ts!H6BhyzbH|2Jw@y*T6RdaJ1B+$OK zyfjfCr)ubLYBt_g{Rs+!_K^2WBCzBy(g8kr>aXwR!S-F{IL+$N`;Vj_{RjE?auiu; z1x#2NCYXrD{?LRuNJfGuEfz|6K>=+0^V&5!(Gmm4cWHv#TSj)D1xIBcWvDvAP?Mss z2(6-uWJQ3>>H+A2uV-|3juOG>5f4fmz`_75ssHVTQMK(N2f7|Pezmb>>jH#o9lH!k6H1j9rlyA3Y5deLvZiSn(@7TW z!sKxucYcV`oXqMGR`!#mX^al-{V&aSTZul~6RV)SSRT6En%6I9D&~T!zgN3by<^Sv}j)$;jWOx)uXJ8OgCT$ytS%U@y5a< zBKSROy<0Rzx2%fB&y#;^-t+byO$+3I1aXo|Rq!O4*M^q*`i$lJN&d^i^@*6?*T?U^ z{6n47H6}}R*7SzN*Dhz@;5)6n0m`5GH$`G*u=`$=3QgjF20*}*?*@3mi+}VF3Xsfv z-qgmWUAOV#g zWMTD;$|x(pV6BvN=4M=svRyT= zoMN#E27e(|#Dr*4+4Y#xLu0_bobwy6L5=v^(U(DJ`~}Nr_gnt)@mE(Houb%aF!c*h zzP-&Pt+NOvut4{s(JDM;iY{LsvZ@9jgq7z1tF5O_meu1`|ItW$tfzFv%RC9<&~b%! z_wTsv!$P%<=TajH9|@>4c-e|T5K6r zJ=J}&Pc-!XS9q5k)9P>t8t^fZI)n6vVqz;u_iBf?x4ws16{`VxF8Rd>;&(--dp$(5 z>Sh$dt7V`7#`#a->qV8nD(&|qr|*93Dt3%GM7J?mK6eHZZ}1F7EG}i-m3`(-d)jZG zr-q>&G-(zvuiaFTW8$N-`8L)8WVe)BRKiy%3IhSGP*H4$=koTt#pF-AOPD~sz|Z=m zuLIafz4pYSve{T_!G)fnsHz}9o|n0MNf&H^I7>*zbwfCsaSI(1DG3WCDM3L&OW9r@ z2QHIt;j(-;=G|wvYm8N(s4>5OJv$#Hd+9(}gjP={OAb;y&M_@`5CAu7-W!aBv$07O z6Bnzlo22W^(j1c4DD{52ZKIAmTk?f?$7XAPjOzHo+_c89x0J-CnyrWbN{UBApd{IYIx{y;$2l4qF$)#dGaxfDT z7RoyxpV_=)de!C8cqahJ2D0bV{JEDFlY52g?%Zz4P5`MYNpi|ssvr3fwP3@Wfnuk13olrTH4J; z%jZyG#qv7ccQM0XPkNSHJ_#Lu?cEzH;WGd|r|{i&-y8__7Qm0$QlCb%dLj0!x;ppB z#sx1%t1~70g>42#u7-w&y7T&x(`l{LrO___$sqA;1ktU1FGXdjS!*eK15GGRU~c|r zZ-ov9;pb0Zy7(sEiY}Z&e$?k%|K}(dO@X_#fw1`e_-pIV@dQM?_L)z2lXPUE4Qxs- zBG#&>T1K~nQ;T($gRltlBF_&O7fX#IpX|QEMz1^FoNaK@t_l6Q2axu?%G6;{@YeA? zUMrzf#nyRG#B(0lXyTKIH)9g>{{!}u#pJqQXb&aA2{JrPF^zAS?hiX?%gmBDV7p#n}u zLr8ax0{%|blG`u~8obp$(}8i()Wii)Io>y|9L#Qm*FrZ#({hYjH)u7E=Wvuk5;y=z zW!azkK21jlgL(D#puwhH$i##$?{cuV&Y^X`$U(D0_s^vOQkUafL>cj0!VOrZFno}v z=W&%?#nWQH>&m{|ia-F*h7L`=iZ9LP2s9>}E7!@71%X>_r=5B(Td789MqPd#U!N|= z%$v1|A%broS&;{U5sE{9G_M9)x}#7({LMPfmQxSx&a!`3;~Q@7S$LFJP*KK4lMb%h zO7?oWO&brFZ5&a5|2m_P@eqSFR4E;uTV=OEJnV8H0<>3w|A`1?UUj5jZCH5ihmDK- zVLNP6WbxMLsRa*B-|;D=4;jRYygi=}K_rqe#xp4$ELP6$bR11(r~3SQW<6U(X9CgE z+IFdNYjafin+Axe9cMdsySZ36S$hvJ`eSdp`1Q+8Vr5yK^m&QreTh`BXhPO_gQXvW z_2(w50Qn;AiqIcA?%1~LBT1=jCWZ8W+GXo~qmTQ#)@e~gqp44qQ6clO1VS8q0#n$X z?j7#YS|5!9Q$>V0j-^-VX!P?f?IiaG?=Sa1gJhji8n9+Od)Djx>^82NmYqlRwQ?5D zIyB{w`of$ee1i7dn%4XTPM)`XMUXC9bBqD9NrYz5wr;nMlJon(gr25I;fZhWEB-7=T>4YLUhZ96gWZ=%q4qUe&sqf5pY`E>}|LfR=dgtz(Z_TT07SE z;`23|`+2c9Pdy)xf(s+ zZ>>ut>t15VShNZ#i}+q@fWEv-oOMo0U^o9O z^b*#3nsYJWJp*OlU0ZtOiQSp1_y4eriNxJpLy+dY93*gWVO}-CO!S#%)Wuklbq9Q9 zCjAx;ky7vL`uU)WNMmgK)%L}wT_YcsgJ|B><`J@I^qADLq8Z>M^S8IQe!DZC9Sd}w zrhf~(0k!RR@NK%y4G2)yEPoL=_S}(Gb^45=S4^($6!~ zYqc1NMSeC~+W@s!43CUmai#R!ehETMw{Nv>!(~8Ax%MB%N|*Be^fNBg(4Kq>9ZJvY`W&NUPE$Ru|;fiK#%pC^haE$n_0H6 zw7G2!(-ki%rUJCwfN{=yFC0CR0AgrVe^v?dI=eFElC?5}K-fH3CDJcnt+$lb`?CxH zNIihcL^*8EYi4@Wv7aDT=-=*UilG-hZ7L>-59(^VAxTa_Vd2JD+v$&4t;crRn`1Cv zqQ~K+9oaK`2OcVqF&|OJ=WHWl3)iO8{>Pi`U0m3P^~--J8tcFU9PNZPK*5=>oR7+5 zV?FfUKjT#}#kw8#du49krn%*>j_Wn9hjV_ub$*S# znKO2g4YVo96F|ibu(5%X z_~Cdf2Yk!-0%Y5R!=onk?V*Z^o-~Y!$*$R58GM-G2G^h^W>5^hsCoF7ClhEWdTw z^Q;HqH5hl`ET2&M6hiG!a5nOs%E`gZeEh3b>FqwTho5~u^17V{~L6)YCgR-gtR8xD=@hm)Y{??5j10z3w#!u2sPftdQcmFQq^yKJp=H&DX z1=&a4<3p$^_Ab1}K&7wgs~NDc5DN8MF`dVBC$jFPeaWtN@IdCQr}uRHsna(135Y42 zt^&$V8nUrU#_a45x>Xq$zpl$7n)neyCm0`oDhcX`a#wO>4LrQ$}1AtS=9EXyYE}ms2J4{g}9g6c5;u z;XH5QuH?uW-)M(a8nk*syH5?{x1ffgYU2v%1OPZc^K3VoOk|FV76zZq=Ok;4*5i;F zAXF2@?iL+2&avv6o0&~1AC8!}CM#?RE1MtWM$>u6G5(?237))~_m~g4_GH2O#tu3> z-lpS)-=)vpWyR`)K4|b!MdI6~YS+}uL&L-0gin&szjpYUh>JsmUw;vKvRnLoU+}qH zTI?*Xv4n9*&+{HjS@3)w)T!jOr6z~bnR5a9;K{^i`oUo?woy&t$JKRMPO+F$r$id@nDTC{C=4otogQXVCH21m)S^ zzarnSJm0Xg4t^o?4VJ9x3h(U|2h%6Mpt^i1x;IEjFGJg%|9jc$KV7Ws|7m*mas3bQP9GwEybZ310ryE0VR2J+t!#sXyj54U(99r4O10@7S?U4YpMGXc}- z>2^2YbnqWOmm|4uqb&i;N*hTx@7n1aS#$F#jaJAm=8f{x&5gD~mLSsBKx{<=R@OIm z`y*J;Q$;@bn#fwcq90Vv;7z_#l0dGcf&)dI$EUS#Vgqc)4Md->Lcy^w4pAWb+Mn{22 zf_2sJ-tI-U(egZU;VWWdlyD*f0|Cg)4^IEg4Vci+2xuRGc50!`oeXqgD!>5;B9^~= zvw8J%wVG84$Mz4LUPO?cUx?$O>E3>*~PFiPJJ)`EP`myb|tsMJdc_IDK z_vHVR*V$eVp~#uPLVTI0LoOmBVzo-obk8Bk_od9FS5;ry|424A_uZGx7=e@KT$_(g zynR=2Z#AZhFeXZN0fdI}47iB3OR%Rsxelj0gwTYBM8JesBd>NI(CX)bUY0{KGkN1e0bFLjGEok3-cw7ojtP_h^LgE%ozg^ ze6M8=H^F4)UxDaF(@3m|D53cbbs8y!NN8MbV(Vw@Nl{TK%U*{SoGi!g!&JJD_f{G+ z+(<>zqF@3M-@2}@ZdQ9;N%MG$k)P+*Aeq0QLdxM6cjb0^mHlQi`$*w`h#22%4^_-7 zjO8WlQg!MqHq&}O6aMl6!j@c{6mn{r!%22Ziu)i?ROy{8 zw_w?NGGlJk@wcz5lI%5G8&uJJczKaiFa91$@wyZE*5-VFsDz^^bvj?zavuKpG5C$G zW<(g9*$_Gk0gsDRm0`zDz4fO%TndS3wX;F!5U_#X52$x|qd=}gK~Fz?Z3qNl2NI#)AF(j(n>RwGknzDI2NI0S0tLH^ASmRh zeSrLC^Cn6xq=b_gh2RGcdj=04jaye zwp+r>iveWn6GFr4wz4+!*=-e}MmM&3`x!!2w%G^ADpNAS!{#O}qL5v+V&%LMY&bS} zSj&PIjZ1b#-gJ?98G;ebYZO~QViQ0?sW#zw9^c`8{qGDqR9LlRbodLY=bQ3BVA~5t zHx$>`*UyKGs;zZi_PJm_gZKVM@E%dy_|i5B(YkbP(B%kDR8%|n0oBfKdv_N|)lR+C z5r$T?7a!NJgDiuanDF$oEnyPm&w73Ae@3IbF^ z8LMtus_xYNEkmcY36?t%$Y+V`9oz`-eiQ~sIzr`K`mTYeT}e*N_mId*gfYPvvK$xZ zAIJ9JY^pR<^fdcK(C_#!TxWC{=dKc~se?g@jFNmO`5UseZd4G6g9`v`{E&Yq^h*GY)t?(Cq z7SNm>2&$Vkyt>} z;oB1g_Z(4Pi)fXR(2Zg1D|r3`i*cr_rJG_wBPt>~x`IbIcc#{S2;R1!DHh5UEL<0XpdoUBIQ8ekbWmRv?zX*@HBjfy1&3XHxc?%RJr>*@-nKQZf z0i)q9SkIgqv6McUCo3Ethb5I#*4E#PU(NloMj>A4QvGEF3RP;RObxhqqCqCrSw_7T zB&=eLoN`V3Zp*Jf2L{?rt0VBCMxX=s*mjc$OO&bF@#*mSm4BBRH9ANvzk`cxJ&XLd zxLj{Ny>1-8x&Cwh(4krQ=+OOiaqE+L`;&0KlMW#aJc>#>F>Ep>Ecq+w1SFKe)tYep z8DZ4kCt-M`I5PxvexAs_9L{OcMh%)U6&j}M>cy&Zh{fOSVX7Cd-phLRfHXozA52d} z-BOz2K^MASM*ehV@mfnuTmq0jS~tA4yh)XAS4kskTdkR&;n9M*5H%3_3Lg>@IXZfR z4U6dl@#7qcXzIR0`s!ykGva3EQE%ilAwMc5^LE#-;E){IodwvecQEYw_CccGaU*WEGG}y zGQzY{*?~tW#2B5*cs!aWfSrWHIDp&)3Ox?K54I2bzMdO*RFAKT#Z>j>eZy)bRD#!E z1*eoH*OJ=f?(ueEdCXyD$DF5~xjBwS*CogMwnEc`83Z8Jz}1``DchM%eHr`_N*+X! zh8u81f-Ja`U~TiER)x2J{82=!6U zfnP`1Fzfg*RDfvEDpouH;jGl@myZ+f3y|&S_h)u5(HR#6^NW2s6gBhMB=dt~O^zPd zAYlIhOU+br#}zsZJ3aOQ8+I;v%R(bzrd21`yay*HQl?i zN``GVYHpy}32!rad*XDsavuSlNEFZ;M6>!Y0n6n|yL>BqTf>n${UzLR?yZa5@YnQoHxG5t|OVHyl! zx&hXbf4gLrH^v7qj3B9f8B9&X z_hlS{;x|?^W+r=Z*#8?$)nQ#{(ZS_u?k6S_{qAN!DtD_e#V{iNeGIyIl(EGN#H{sv zS~QM;O2}5IR;<)%uRoI9ai2P$Nlw`>Mjoo}30oK~7BCDC4ZB-FgBX_xvM>waaCK`K zUyc4Wz*zk?7bXSP8MrsS90I(gcch(9RN{Qy(D2lVOw~Zh3eZs_YXl=S2LIE=y-cPtbs*(!A!ijSVZ?h2 zr^@ZLk~%yM2?HTrQG-uh6_#t|*%d>3nL6C=C+%=Rtt$^1^0c&;_rG>Be_PE(ZrmML zXP`c8}DZpsXI&20LN;D68L+iwAtIIvrG1mi+s4Uh<8qE}(?^vT~ulkfK zO5r|=2B?_3XAouIaK>F?Z3UwXCuAgIV$rSsGd~ObtCq4K86Xws>Qs*Pqx4n1kK@6+ zFE7#-VY}b;q}520j$x9m9};8QV)~*Pp@xFQ%x?q&^%($O#qI+1^BZi}1Vk%F&vc%yYa2Q}ubbA-AnW$%Qj?vJEMdHv61v1^jYCS?q41CPS(XZD;(~w&aI*aE~0^v zx`oCn_b&R_OBnM$Pnf~#`#KFR%VRrjZg{*uy=NNaOX*;?ajWC&*=X5ex)fWWr_ekI z-Xs_^nnXv0avn}7mZ&CtVDD+-cRWp^3+cQ@FfT*kE~HqzSUFiKwcvqS#PQsugUl$02NsI81-x#jmDTTRze4{K^#J#T*X{7^s2CP59;O-FXj96iX6`Oyqh~dJZ-kBh=2z3y7 z4f=(SqaD>($U=2HZ<0-AT>xfk>!p1a?vVa%6VLpN1&Q8*iaOSFzZ@AGGu#mIH6KE% zBBHk;pV+woO&TEHUkB%GwFraAV7yO;UIc(2e%bso)G1}Umw4D0d}uL^^=b~67u>25 z!xDla-+$$P&Ve?|u74%R5_O0ew`oIO!s!coW6)(28GLB~w1?1-P0F^!Z0dY{&C*i^ z*x}WQlgYt?x~gteqX(E!u{bwQD+)Mme00(YQUSN4<@TWE5I23$s<#@5COiQjVexMGwt5W&=I@{fGWIxc0QIp72p`cw|Ql3THA&jCS6o(uJ! zFj6t3h0X9WHk(zT$Boi6E@-qW?uLg-3c(>hDE|7}IQ-XU96k;n59nq++;6?3PlS0Q zW6+lBG>o2OYsFXU2sxat_I~FH*&lge7%whT-wVrIwB2Xu?f@&G$I~sIme;%*b&=Dn zL9Q5A4s~_)AC{IDzDH?Y+xHO>%=Dq|R|1QsdAIyjVM^j1vVsqbmCTj$oXS4_;zik0+Dz{xr( z`i3)oKDITNT6%@tPN%{(Wa&{&+-`ZVkzLw3KYAg@y zK+XT?_*? zSB;)YjEggd%tl^>l6owlmA0IU&sq`vwMY383{(m(PrKHCs??_xaXE#8AR~&B-Rz3B zoAR2Pu2`!r>odKQkojQaee8gNwq`!U#To|VrxgT(reBq0-arhZmsCOHXd!)zU{ zS>ev&XaYui1?UId$8Tvxopi06dzu!T^hsZt@cmOi1qN$Ji;{y+(KC8@!pXq~1h&>8 zNt90JhL7m|4ab6KdwRy<5t0#HC+XBKoxGo%R01QwGT+BhheJm{SZVE6KBDz~RU655 z*?0O^0%%??7!@ET=qu#yH|H>LgEUtn76Q z3e$|w^%K@2pRuCf{JCsW4La}dkZZK(iiNhah|{;gJ@J8`8jBO9+h|`c!`%EC?&Jc1qA3LFQzu#t#;u?%5L=6QutigqP#qx4UnmW~s@D`sUwj^$cmEsl#R*S62VZ;x-OV9Ze%=jI4&bl%zQYWo}9dV^>NG9&cQFm@P>S@ zd6Q3B65WelrSZ}@NQB}(M6#E%?>ajA!7}s?8{6v~UKvogWwz=~1^+lu^*z^jlr&NW zH+#n}x4pXW4K&Clfz|TnUH7@!7US2gOKc-{n0$B!Fv#>eX-pr-<^U@OR3Rg8 z+&oY#|4go?e?w`279_pmF3HEmzWc||f4KO$Vs5iur^SDBt52^gsOxM>Z=z__!|jDE z(-VyAIBmqWDc_{PgziR7UvtvOcRV#VrW{w%XFsRHh1Iwv?q0N{r1R{0DQAB4uL(#s z$y*scReuS$qW-R)DL9#9ctkNlSjsBsqlxpDtfxX6jR?XV>j|k8jocha>W~t&KC7M?v88q{B zY?Ei$Hc|zN31F3)6m^$FB!6!^;_m?Y`%4F%gh(!e?rMXme4O1E>Wt)~`te3;dPlCq zJbAL8r$pIQCVp)&WagHII;_0Pc^#Ombq|)5fL`W?&{@E?E&qIdNom2t$oSpQmY(d@ zt5=^tv?xbgf~rtoH0$lK5KXb~yUz4DcOi8QLVE`s!mieNXW>WXRDCQA1X$?N>Hs;G z*oJGZxG)pV3CiwYXX-@q)KZ!+V+D=;!G5Pw3Ih!xxP_C5r8witJr3A-NJe5$Af%&q zlnhyc-gjQPIxP97^Getri!Jm$&<;(J}N|lo`4dEcIjK_D810z)C@PAJ2R`z7F!&Ad_%FM z73~W%TpG!yG1>%&hwP>#g_1c+Vi_E|=afWHwM9!6IxIDUmmOy*->YftBN6+}TEq3N zVtUgD-%e%tiRH^#bH}-@{_mgItF#{WNU%gqfcU92P)03tHHK{dys?IkxH?~_Ju@Rn z&haZcv*y`Zs>fql*h6MoN}RsRo`LIk~|Spycw*es>v15V9#M6r zR>4vo676tAr@kx%;6mGgPDI0^5*sCI!fu7Ip2N`F68u z@l0R9~Pjo`yd;Kyq%r78)-$$Ee?x8 z`36jw8(VKo_zPFln8yy6vorSi#c&VPN$6?$r~C(rKb*aGoc>QOK1Z+S_Aah$a;S3Lw* zk+HeuItmx>kb>Za5L~B-W|DV1DQ>HnF-Is^ zn_z8%@v`%%)Pzb<#*JQ6?U9HS{heLhSPHN9G5!)!?g>*f@;dSd80tMQXJcnRTak|> zmuCC=&lUaWL-f6uhv4?s1NS^QJ*dFR^q;TWA&TH5VEew^u{f*0$C1i(bUjK%O?_)9 z!Mnl^_4}=|U1Tqjf4tQe^1?T)TtkR4F`SA}@Pmx_(LNCo9g@Sn*#lWtL41VN1~g0Vpv`HLU%mT@lyNId`ws#P2|G6p$DRm%2ZFj)2{Dxi@3 zPG2t~Amwc)(i##vcZ}mW&Q;NdGO(9lHstwBjMR?DL}n(u2GKe~5nCX_oq~?mXH+7D}7?1Xmk~@>3=`H$VfN-%ued;)t%{L zxpAMyBcyq`10H7ddO-XcL|_Q6iH0wJ%uHP~&JUO{GFy;dooo*}97R!kx~G$t3k!sr z6-)Vk%98*V@BNdL6Uxa%?)Z43zTCf8Maxtto4?Fol=U!VO{0Y>6-o*<2B zj=GQlt8|bWAO}x8JaN`nO9%}b-N^q8Ree*OBUm8CZ_{~DeE)r_St;nGT9|mkA*g=s zvN`FDX^mvyR`R^J;&m$dySLI~Iwer9aY|swvuZ=66yTpiUjbl^%h?-CQ&8c&t*OfN zpWXk*%m*QNm!t9nV40Xo0XGeaT33s{fQI|sBj^vE0vNiKwGSTYH#~VW9IlgfGWT_6 znq2VcL{m=5wu`fV`74chXix*j#F<Gy_7>vz9D$u~E!yt-aziv*RN-?i!muG^F6w6G&NbRy7ub$yZPIk&rAKNG7+@+4t|_g+OvX?)mD2oo#TJOufy&-o2x7Q^jS^< zFxB%PEb?GsasR}gwUxlZB-f>YQC;-bl*)sl4E)vdu~%iYzh149as(Lc#GF?J7@>v2 zHi<)G096?zC2gJ;B?||E!$S>N>pJd8W<2SmJ#e@~0NGHF+)NHk&bWSl3xYdQ`R2<|-lo_s%yPu&tV# zKUf6jYCu+9wT)Q%mhe_jB^m@H^?i_s|39yqbq%_Vi|BMY{|nrC3H6Up?Kx=-m_ea)K7sK!7$0+kQkwg0)g9f@|wc(|#O1njX|sjXjK?yT1O_OqA? zQ!id(Ic<{S73VlXv+$sLqCTx|it#ZdSno1FZyd<_9j!^#_w|Ilx41js`^&<~Il(=2 z^(FdqF5yEOrXed%s>8QZYJ3*`G~hYl$DcACc{fIK@@I6!lB{Qwlg2cWR_Y1@$j{=* zsf#E*tVh^195rjnh7{&ybLUx%R8K0r_)AGWMMtKt>AeiyWUv&itcS_I;o;?cZ66X; zAHtBiVIB6q|0a?DWag|g$x#hPKzT2nP3Z~EW{U)qd`Pj0N0d_L$+x^4uY0&jl{1Q6 zx$ZfAxLqG~n%Lj9!efTOI1Sww?Ct$emXN|2C_*(T&kTm0dmwYZTM}OhMplb>wbBDF zXs-7-5?^_Ec+g{E0^E357($DTxnNJ3n30!D z3QKv4du1;a0vhMZcy=6GU82e#yx@PZwlu$3on5T7uRp4Rdnf&1e= z`b{GO56H6>=gpn^jYNP-bNcr>eHLIakw!eZw(W|DPak#nKZwR4IQVDDrwC)fPJnKnkM?fT75^<^Wf1pr&y2=Hm$opEl+@=yEn(gRa+1M09GGh2m)W@Jy zGRgcW-`M#1J*p}%VA1h^!ftBcdrj{s5rq#}hF->A^+7Q-*lS1NXEIQ1N zn3xKh(#&)cU)b4^pA?4OZnHt`bo@7KgH=O@#@f-Jm?2O-=(8+5>T&-^z#Vg)bR0AD zV0|bZgNmEoiv`P0F^Vz19=emnW`i&KY5$Y#M`sMke2(??F-^}d*#I}7s2gN~r{jk}cF#NR)G zDrFEN%cDU%wTU8jgLd}az$=kN2XRkC(#0o1ltBD0tr4G+Ex6xAJ zEheTwST=i^#5ZmDp?Jy)9;+&5e$qyej z*Y{T3ylHVNnP6-QWmSAm1gLeTFX{Reb+WiqCA8XDSy+belhJP=)x7U`dF$xzo&!A7 zW`b-;vY3Zp-`Bqd4gd}JhZ@A=NaNd#q~>E^}Vn&+V;Z^pw%jE8Q z)0yEnb(Rfs`Mf}m8~CFSym9hf8f@vbO;sG!9M~k1Jt-<>Ac!Yc!ulGyltRfEWCr3b z$uXrm1SP(L;*OZPC_OuN!ACH@xf<$#%pVSla&t7YK^L3DV~WGH*>8TIuBz_kL)NYXUHPyw?ia30LS9*W zE28@OhS=al53}{@XmZ!AYklQ*)UIk2`TO`GA#?^fY^CL>HMbq>73A;PKc0&fne8Ei zCQA8?WJYG*!6-`|A0Iu0MZ)a`!Lp?|1|6p)NE=>lyrW|JnnI-u1@z_@a(%br#BDSI zy_vXis8+j9MLtD0v3z#8m1HQ{rlrc-@I(Iw^lZOZ#rc1nv4{R04+ zI432sD915e@!tJhe&g&l100P5#>s)_zI z%n^SZY%iVj`@5w4?wlI{pUdcW`PgYau9uT8=oJYxH7nIIsB99LG|vSBDKoj;bVUKn zsxR==Lw9+!Abi0CndX`&NQe6K_!;9|n!3~Nf6dX;dK!vc!v`;JBVv^e;u$n2n?(>7 zB`838>kVIuyY9;Q;JQ?IG}~%_6_%m+S>1$g%gM*5s$7SRj10}%aT~)dezFEz&65u( zIV~i)TTBB!ER}$e2c`k}&FrT%$@rsW;e-t6sgGuABRaTjGJ_?PhFzQDEf$Ub)A{d} zYulmglOVVj+b{678ceu*I5P8otQ--mxXG}xViv?EYDxvkMa~EW}O z-Ye+5gg#)|9MNfrf7jG+<8Dh0r_yqZ#DWY7rVPCX?oTIQe#zK_w{=jkUN))HihRhC zeaD$#h;a*LD4Eru5SP+aCOFCqa2wHM$n-fT;h>tqBwz>HV98BwHJ6{_EP&Z6vF-D0 zfJ9?_l@FDY?0990@w^Oo1~ zYyw~p&LjQ9Upr^&&%liQP-bJ}<|9-1|Bu`lbpC+{kzHHHK7&RqlNMx!e>do_(F6ik zqyA;O#>Nu|YlU&zZ@*fF?5^b(VBvN`WN@o~yA1!)FQC@XtJN8)xlIp1J>L9%*sQdw zml^i$@Oh+A(3yW9gyZGsgWrW)=W28F(nzym8|YD;_2r<&Z+$CL!ECSd#t{V@bli`X zprEFPIs2<%xIy#mY%__Pwg!5|TVnZ#9!mCzX)40KaQ;m3eNLB<1SEx7VGu1koixrr zI?tx0tm6XMlS}e93(q`zu>^L#b^4z?^)K`B_4OY9LH)6z>sWqfmlC!3h}(hSp#uNp zS==Y@I>g$7YenaQpZH;M(o>xf2xgqt%$$Qjq`D+W4{uY1&EKQjEZvH8EKE10j7mRd zLzdS})gGQClK9&&%}1+RWquO@iluM8h7}bWW0KioAQ*O$<;bz5%o(>~GCl5IxPXz?WenkK1k+ns)6Ru4IpPC@VJ~bU; zqV{jg`L#+4Ldo^cq6BK|Bi@8h-P{-3eRrH0^jr0}K_V__+2l!vvjT1hi$YWJ5@zPf zQ&mn@P7MJ>jgb)Y0nRs!xMq5oy8bGQ^x?u%ekq+-6d%z8zOud$bwpZ4i3Ex|Nc)q* z$W{1HxkLnIudxfcCIa5+mRq-W5m$!6p{s(<{Y{k~z(St^wGMt>hKtFD*DTTNvQdvw zFe^^EP5D+xHZyui>6oN4{6?Iku_zhyYjdkfOdoBuxe6`~9&&pQ0bFEKw zWxls(>wU9mw70a*0dQ0NoM8|2gvrP=L(Rt-zmf_KrCf5q{Mebcnl$_$Ru*1P+#K1W zG^I3qRq`O8Cnjrmhd68j-8RIc74G-;md41eEK6mryc)tgm+fFhCvI<=d~0G?behYm zZT#>kzPmJ~bH6BCQ2n;oUm|C>C$M&A%)`nq(4#G;vzHB+(-6%eVt+aU#emxsBgzVk zVn>6%Iw$sU@vt4}3;vl5n*8f*cB3RfT>D8MJLfNA-fuZXxJB%_>FLOgJDmd8P1nw3bcx1UP@}2@HJC%mfGYUvV^p@T_;c7mg;PJ@NmCG#33naRk^j!RLx|6Zd8Kbp`AEG$h!AxrOmT zYw84F6Pbm4t6p2E-0U}Y)^|cSOLRDvtrHNOaQ|3>@Kija(7%{FUOx`Nh3auX#S0ix ziq55K`0;(B>2mm(WBM6Yn8ibJaY)RB%d0%Ju=h9>|2xeJWh-LDa$|KQ@rwOcMn-BtAVR(i9B?w?rMDJdU<)9T6U1ezk z-jFfs>!U5d^uP2#&gPJ}n_{h02}9o3gk}!83zhyClT9`U$3-N0JA3Lm^qps6I@ETm zYRDjYXmgdUxV)L(+4`#CDnbbHoH4OlD(Id-5x!QONyL8>ns~oi&qr>4@2^J;6zMYV z4wcI?7m&?#lBADeDWT7TKJoabf(Sq91suxiw%yAZ8%yuDsxZt8sLH1nee#zr^jx(=m z%RI`fGSgFlEHTH)15((7-^mAWiPk)WLm_ZQbMgwqC^=5aEA6$($SUG&zugbjdBT%f&!<6Q%H zH=EXy+~raUgKOqLtdUgc_lq|!Me^TOL!hkP2lsIfB%&=rS<@XBAHol3oR`P1ByYzm zfOF8;6}|181f-FK?KMN?35QFk^?J%uHEbQ@K5RXd1*7dpFp7TdBISf*Q4`0=95TkJ z*{c-x^8MQ+xA|-mWNW$~oxx3=!D3$=$@i8o@J_~+7d$=^=~h;YktmW*-ra4h08(RJ z&fu_!a`&eoY20ip&7;Pr#0N**q%EE$vHS5Rrr%Id3D(L$(y(h6ndRe}@)!FmL0tL* zRF{h)9Qwpv3v388v<;+1ME-#>A29!#-(zocd{2xo&tj((gMkxou3NHLH!ftsS=Zvw zZF0=H;TVhA_$8_@bz_t8XIe^GN99G8`tQxn0iilC`fiTgk1dw>(Tzk+6;x**@WL$p zQJ@=Io%eHxSx1DhthDCrfpm^5Ja3haq|<#f{IXm<%dj4_J?&WHw){wa+M=mloIHlN ztJx)x3A(Ib!*TWs#~{7RLth zSAATi59wgv`5q({ru)W61?xhx){GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ diff --git a/samples/client/petstore/python-asyncio/tests/__init__.py b/samples/client/petstore/python-asyncio/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-asyncio/tests/test_api_client.py b/samples/client/petstore/python-asyncio/tests/test_api_client.py deleted file mode 100644 index bf4ab329f296..000000000000 --- a/samples/client/petstore/python-asyncio/tests/test_api_client.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -import unittest -import weakref - -from tests.util import async_test -import petstore_api - - -class TestApiClient(unittest.TestCase): - - @async_test - async def test_context_manager_closes_client(self): - - async with petstore_api.ApiClient() as client: - # thread pool - self.assertIsNotNone(client.pool) - pool_ref = weakref.ref(client._pool) - self.assertIsNotNone(pool_ref()) - # pool_manager - self.assertFalse(client.rest_client.pool_manager.closed) - rest_pool_ref = client.rest_client.pool_manager - - self.assertIsNone(pool_ref()) - self.assertTrue(rest_pool_ref.closed) diff --git a/samples/client/petstore/python-asyncio/tests/test_pet_api.py b/samples/client/petstore/python-asyncio/tests/test_pet_api.py deleted file mode 100644 index 09d48581a400..000000000000 --- a/samples/client/petstore/python-asyncio/tests/test_pet_api.py +++ /dev/null @@ -1,212 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pytest -vv -""" - -import os -import unittest -import asyncio -import pytest - -import petstore_api -from petstore_api import Configuration -from petstore_api.rest import ApiException - -from .util import id_gen, async_test - -import json - -import urllib3 - -HOST = 'http://localhost:80/v2' - - -class TestPetApiTests(unittest.TestCase): - - def setUp(self): - config = Configuration() - config.host = HOST - - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) - self.setUpModels() - self.setUpFiles() - - def setUpModels(self): - self.category = petstore_api.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = petstore_api.Tag() - self.tag.id = id_gen() - self.tag.name = "openapi-generator-python-pet-tag" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def setUpFiles(self): - self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") - self.test_file_dir = os.path.realpath(self.test_file_dir) - self.foo = os.path.join(self.test_file_dir, "foo.png") - - def test_separate_default_client_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client, pet_api2.api_client) - - pet_api.api_client.user_agent = 'api client 3' - pet_api2.api_client.user_agent = 'api client 4' - - self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) - - def test_separate_default_config_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) - - pet_api.api_client.configuration.host = 'somehost' - pet_api2.api_client.configuration.host = 'someotherhost' - self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - - @async_test - async def test_async_with_result(self): - await self.pet_api.add_pet(self.pet) - - calls = [self.pet_api.get_pet_by_id(self.pet.id), - self.pet_api.get_pet_by_id(self.pet.id)] - - responses, _ = await asyncio.wait(calls) - for response in responses: - self.assertEqual(response.result().id, self.pet.id) - self.assertEqual(len(responses), 2) - - @async_test - async def test_exception(self): - await self.pet_api.add_pet(self.pet) - - try: - await self.pet_api.get_pet_by_id("-9999999999999") - except ApiException as e: - exception = e - - self.assertIsInstance(exception, ApiException) - self.assertEqual(exception.status, 404) - - @async_test - async def test_add_pet_and_get_pet_by_id(self): - await self.pet_api.add_pet(self.pet) - - fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertIsNotNone(fetched.category) - self.assertEqual(self.pet.category.name, fetched.category.name) - - @async_test - async def test_add_pet_and_get_pet_by_id_with_http_info(self): - await self.pet_api.add_pet(self.pet) - - fetched = await self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched[0].id) - self.assertIsNotNone(fetched[0].category) - self.assertEqual(self.pet.category.name, fetched[0].category.name) - - @async_test - async def test_update_pet(self): - self.pet.name = "hello kity with updated" - await self.pet_api.update_pet(self.pet) - - fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(self.pet.name, fetched.name) - self.assertIsNotNone(fetched.category) - self.assertEqual(fetched.category.name, self.pet.category.name) - - @async_test - async def test_find_pets_by_status(self): - await self.pet_api.add_pet(self.pet) - pets = await self.pet_api.find_pets_by_status(status=[self.pet.status]) - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), pets)) - ) - - @async_test - async def test_find_pets_by_tags(self): - await self.pet_api.add_pet(self.pet) - pets = await self.pet_api.find_pets_by_tags(tags=[self.tag.name]) - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), pets)) - ) - - @async_test - async def test_update_pet_with_form(self): - await self.pet_api.add_pet(self.pet) - - name = "hello kity with form updated" - status = "pending" - await self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) - - fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(name, fetched.name) - self.assertEqual(status, fetched.status) - - @async_test - async def test_upload_file(self): - # upload file with form parameter - try: - additional_metadata = "special" - await self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata=additional_metadata, - file=self.foo - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - # upload only file - try: - await self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - @async_test - async def test_delete_pet(self): - await self.pet_api.add_pet(self.pet) - await self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") - - try: - await self.pet_api.get_pet_by_id(pet_id=self.pet.id) - raise Exception("expected an error") - except ApiException as e: - self.assertEqual(404, e.status) - - @async_test - async def test_proxy(self): - config = Configuration() - # set not-existent proxy and catch an error to verify that - # the client library (aiohttp) tried to use it. - config.proxy = 'http://localhost:8080/proxy' - async with petstore_api.ApiClient(config) as client: - pet_api = petstore_api.PetApi(client) - - with self.assertRaisesRegex(petstore_api.rest.aiohttp.client_exceptions.ClientProxyConnectionError, - 'Cannot connect to host localhost:8080'): - await pet_api.get_pet_by_id(self.pet.id) - - -if __name__ == '__main__': - import logging - logging.basicConfig(level=logging.DEBUG) - unittest.main() diff --git a/samples/client/petstore/python-asyncio/tests/util.py b/samples/client/petstore/python-asyncio/tests/util.py deleted file mode 100644 index 8edec7570093..000000000000 --- a/samples/client/petstore/python-asyncio/tests/util.py +++ /dev/null @@ -1,18 +0,0 @@ -# flake8: noqa - -import asyncio -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) - - -def async_test(f): - def wrapper(*args, **kwargs): - coro = asyncio.coroutine(f) - future = coro(*args, **kwargs) - loop = asyncio.get_event_loop() - loop.run_until_complete(future) - return wrapper diff --git a/samples/client/petstore/python-asyncio/tox.ini b/samples/client/petstore/python-asyncio/tox.ini deleted file mode 100644 index 8989fc3c4d96..000000000000 --- a/samples/client/petstore/python-asyncio/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/client/petstore/python-legacy/.gitignore b/samples/client/petstore/python-legacy/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/client/petstore/python-legacy/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/client/petstore/python-legacy/.gitlab-ci.yml b/samples/client/petstore/python-legacy/.gitlab-ci.yml deleted file mode 100644 index 142ce3712ed0..000000000000 --- a/samples/client/petstore/python-legacy/.gitlab-ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.nosetest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest - image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest - image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest - image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest - image: python:3.8-alpine diff --git a/samples/client/petstore/python-legacy/.openapi-generator-ignore b/samples/client/petstore/python-legacy/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/python-legacy/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/python-legacy/.openapi-generator/FILES b/samples/client/petstore/python-legacy/.openapi-generator/FILES deleted file mode 100644 index 5835827fb98f..000000000000 --- a/samples/client/petstore/python-legacy/.openapi-generator/FILES +++ /dev/null @@ -1,126 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/models/__init__.py -petstore_api/models/additional_properties_any_type.py -petstore_api/models/additional_properties_array.py -petstore_api/models/additional_properties_boolean.py -petstore_api/models/additional_properties_class.py -petstore_api/models/additional_properties_integer.py -petstore_api/models/additional_properties_number.py -petstore_api/models/additional_properties_object.py -petstore_api/models/additional_properties_string.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/big_cat.py -petstore_api/models/big_cat_all_of.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/format_test.py -petstore_api/models/has_only_read_only.py -petstore_api/models/list.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/number_only.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/pet.py -petstore_api/models/read_only_first.py -petstore_api/models/special_model_name.py -petstore_api/models/tag.py -petstore_api/models/type_holder_default.py -petstore_api/models/type_holder_example.py -petstore_api/models/user.py -petstore_api/models/xml_item.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.travis.yml b/samples/client/petstore/python-legacy/.travis.yml deleted file mode 100644 index fcd7e31c7ccf..000000000000 --- a/samples/client/petstore/python-legacy/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python-legacy/Makefile b/samples/client/petstore/python-legacy/Makefile deleted file mode 100644 index ba5c5e73c63c..000000000000 --- a/samples/client/petstore/python-legacy/Makefile +++ /dev/null @@ -1,21 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh diff --git a/samples/client/petstore/python-legacy/README.md b/samples/client/petstore/python-legacy/README.md deleted file mode 100644 index 3d5bdd33435c..000000000000 --- a/samples/client/petstore/python-legacy/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen - -## Requirements. - -Python 2.7 and 3.4+ - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -from __future__ import print_function - -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -## Author - - - - diff --git a/samples/client/petstore/python-legacy/dev-requirements.txt b/samples/client/petstore/python-legacy/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/client/petstore/python-legacy/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index 6d5625857d5e..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesAnyType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 934c43272a94..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesArray - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 577b141d4703..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesBoolean - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 3b789c813670..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_string** | **dict[str, str]** | | [optional] -**map_number** | **dict[str, float]** | | [optional] -**map_integer** | **dict[str, int]** | | [optional] -**map_boolean** | **dict[str, bool]** | | [optional] -**map_array_integer** | **dict[str, list[int]]** | | [optional] -**map_array_anytype** | **dict[str, list[object]]** | | [optional] -**map_map_string** | **dict[str, dict[str, str]]** | | [optional] -**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional] -**anytype_1** | **object** | | [optional] -**anytype_2** | **object** | | [optional] -**anytype_3** | **object** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 4a5e49e0b020..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 39a8992fd4a6..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesNumber - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md deleted file mode 100644 index ec590e3cf96f..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md deleted file mode 100644 index c7cc62130506..000000000000 --- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesString - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Animal.md b/samples/client/petstore/python-legacy/docs/Animal.md deleted file mode 100644 index 8bc43ab53f33..000000000000 --- a/samples/client/petstore/python-legacy/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/AnotherFakeApi.md b/samples/client/petstore/python-legacy/docs/AnotherFakeApi.md deleted file mode 100644 index 047c4ae6444b..000000000000 --- a/samples/client/petstore/python-legacy/docs/AnotherFakeApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(body) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/ApiResponse.md b/samples/client/petstore/python-legacy/docs/ApiResponse.md deleted file mode 100644 index 81a7d0d85227..000000000000 --- a/samples/client/petstore/python-legacy/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index b53b6cdb8c46..000000000000 --- a/samples/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **list[list[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 6116bc7489fd..000000000000 --- a/samples/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **list[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/ArrayTest.md b/samples/client/petstore/python-legacy/docs/ArrayTest.md deleted file mode 100644 index 81420a3b9bbb..000000000000 --- a/samples/client/petstore/python-legacy/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **list[str]** | | [optional] -**array_array_of_integer** | **list[list[int]]** | | [optional] -**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/BigCat.md b/samples/client/petstore/python-legacy/docs/BigCat.md deleted file mode 100644 index d26809fcff80..000000000000 --- a/samples/client/petstore/python-legacy/docs/BigCat.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/BigCatAllOf.md b/samples/client/petstore/python-legacy/docs/BigCatAllOf.md deleted file mode 100644 index c3c42f41da55..000000000000 --- a/samples/client/petstore/python-legacy/docs/BigCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Capitalization.md b/samples/client/petstore/python-legacy/docs/Capitalization.md deleted file mode 100644 index 1ddeadeb3f46..000000000000 --- a/samples/client/petstore/python-legacy/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Cat.md b/samples/client/petstore/python-legacy/docs/Cat.md deleted file mode 100644 index b3eff72b3095..000000000000 --- a/samples/client/petstore/python-legacy/docs/Cat.md +++ /dev/null @@ -1,11 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/CatAllOf.md b/samples/client/petstore/python-legacy/docs/CatAllOf.md deleted file mode 100644 index 0ff7809a99ac..000000000000 --- a/samples/client/petstore/python-legacy/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Category.md b/samples/client/petstore/python-legacy/docs/Category.md deleted file mode 100644 index 095459c80b65..000000000000 --- a/samples/client/petstore/python-legacy/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/ClassModel.md b/samples/client/petstore/python-legacy/docs/ClassModel.md deleted file mode 100644 index 48ed7cbf2ff0..000000000000 --- a/samples/client/petstore/python-legacy/docs/ClassModel.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Client.md b/samples/client/petstore/python-legacy/docs/Client.md deleted file mode 100644 index c3986008d6c3..000000000000 --- a/samples/client/petstore/python-legacy/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Dog.md b/samples/client/petstore/python-legacy/docs/Dog.md deleted file mode 100644 index 7eeaf5b68515..000000000000 --- a/samples/client/petstore/python-legacy/docs/Dog.md +++ /dev/null @@ -1,11 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/DogAllOf.md b/samples/client/petstore/python-legacy/docs/DogAllOf.md deleted file mode 100644 index 6382bbd80671..000000000000 --- a/samples/client/petstore/python-legacy/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/EnumArrays.md b/samples/client/petstore/python-legacy/docs/EnumArrays.md deleted file mode 100644 index 92de0e955650..000000000000 --- a/samples/client/petstore/python-legacy/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/EnumClass.md b/samples/client/petstore/python-legacy/docs/EnumClass.md deleted file mode 100644 index 64830e3d1dee..000000000000 --- a/samples/client/petstore/python-legacy/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/EnumTest.md b/samples/client/petstore/python-legacy/docs/EnumTest.md deleted file mode 100644 index 1911bfa918cd..000000000000 --- a/samples/client/petstore/python-legacy/docs/EnumTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **str** | | [optional] -**enum_string_required** | **str** | | -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/FakeApi.md b/samples/client/petstore/python-legacy/docs/FakeApi.md deleted file mode 100644 index f91b85f16367..000000000000 --- a/samples/client/petstore/python-legacy/docs/FakeApi.md +++ /dev/null @@ -1,943 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | - - -# **create_xml_item** -> create_xml_item(xml_item) - -creates an XmlItem - -this route creates an XmlItem - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body - - try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) - except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize(body=body) - - - -Test serialization of outer boolean types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(body=body) - - - -Test serialization of object with outer number type - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) - - try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_number_serialize** -> float fake_outer_number_serialize(body=body) - - - -Test serialization of outer number types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 3.4 # float | Input number as post body (optional) - - try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_string_serialize** -> str fake_outer_string_serialize(body=body) - - - -Test serialization of outer string types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) - - try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | - - try: - api_instance.test_body_with_file_schema(body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, body) - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - query = 'query_example' # str | -body = petstore_api.User() # User | - - try: - api_instance.test_body_with_query_params(query, body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(body) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) -int32 = 56 # int | None (optional) -int64 = 56 # int | None (optional) -float = 3.4 # float | None (optional) -string = 'string_example' # str | None (optional) -binary = '/path/to/file' # file | None (optional) -date = '2013-10-20' # date | None (optional) -date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) -password = 'password_example' # str | None (optional) -param_callback = 'param_callback_example' # str | None (optional) - - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - -To test enum parameters - -To test enum parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') -enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') -enum_query_integer = 56 # int | Query parameter enum test (double) (optional) -enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') - - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) -boolean_group = True # bool | Boolean in group parameters (optional) -int64_group = 56 # int | Integer in group parameters (optional) - - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(param) - -test inline additionalProperties - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = {'key': 'param_example'} # dict[str, str] | request body - - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) - except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**dict[str, str]**](str.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pipe = ['pipe_example'] # list[str] | -ioutil = ['ioutil_example'] # list[str] | -http = ['http_example'] # list[str] | -url = ['url_example'] # list[str] | -context = ['context_example'] # list[str] | - - try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) - except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**list[str]**](str.md)| | - **ioutil** | [**list[str]**](str.md)| | - **http** | [**list[str]**](str.md)| | - **url** | [**list[str]**](str.md)| | - **context** | [**list[str]**](str.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 66b43fb1ea11..000000000000 --- a/samples/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,82 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(body) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/File.md b/samples/client/petstore/python-legacy/docs/File.md deleted file mode 100644 index 63b1d1a65186..000000000000 --- a/samples/client/petstore/python-legacy/docs/File.md +++ /dev/null @@ -1,12 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md b/samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md deleted file mode 100644 index 58d71b7a26be..000000000000 --- a/samples/client/petstore/python-legacy/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**list[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/FormatTest.md b/samples/client/petstore/python-legacy/docs/FormatTest.md deleted file mode 100644 index 239b60134ab5..000000000000 --- a/samples/client/petstore/python-legacy/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **float** | | -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**byte** | **str** | | -**binary** | **file** | | [optional] -**date** | **date** | | -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**password** | **str** | | -**big_decimal** | [**Decimal**](Decimal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md deleted file mode 100644 index 0e1334519a8b..000000000000 --- a/samples/client/petstore/python-legacy/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/List.md b/samples/client/petstore/python-legacy/docs/List.md deleted file mode 100644 index 4b60956971aa..000000000000 --- a/samples/client/petstore/python-legacy/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/MapTest.md b/samples/client/petstore/python-legacy/docs/MapTest.md deleted file mode 100644 index 8f136137b524..000000000000 --- a/samples/client/petstore/python-legacy/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional] -**map_of_enum_string** | **dict[str, str]** | | [optional] -**direct_map** | **dict[str, bool]** | | [optional] -**indirect_map** | **dict[str, bool]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 46fb6992509c..000000000000 --- a/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**dict[str, Animal]**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Model200Response.md b/samples/client/petstore/python-legacy/docs/Model200Response.md deleted file mode 100644 index c958bd4b33f8..000000000000 --- a/samples/client/petstore/python-legacy/docs/Model200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/ModelReturn.md b/samples/client/petstore/python-legacy/docs/ModelReturn.md deleted file mode 100644 index 043e9d466fab..000000000000 --- a/samples/client/petstore/python-legacy/docs/ModelReturn.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Model_200Response.md b/samples/client/petstore/python-legacy/docs/Model_200Response.md deleted file mode 100644 index 4fd119d12515..000000000000 --- a/samples/client/petstore/python-legacy/docs/Model_200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Model_Return.md b/samples/client/petstore/python-legacy/docs/Model_Return.md deleted file mode 100644 index 674c441551b3..000000000000 --- a/samples/client/petstore/python-legacy/docs/Model_Return.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Name.md b/samples/client/petstore/python-legacy/docs/Name.md deleted file mode 100644 index 3be719cdbfba..000000000000 --- a/samples/client/petstore/python-legacy/docs/Name.md +++ /dev/null @@ -1,15 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/NumberOnly.md b/samples/client/petstore/python-legacy/docs/NumberOnly.md deleted file mode 100644 index 37195c5d8994..000000000000 --- a/samples/client/petstore/python-legacy/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Order.md b/samples/client/petstore/python-legacy/docs/Order.md deleted file mode 100644 index f360fffe8149..000000000000 --- a/samples/client/petstore/python-legacy/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to False] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/OuterComposite.md b/samples/client/petstore/python-legacy/docs/OuterComposite.md deleted file mode 100644 index 31013673df73..000000000000 --- a/samples/client/petstore/python-legacy/docs/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# OuterComposite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/OuterEnum.md b/samples/client/petstore/python-legacy/docs/OuterEnum.md deleted file mode 100644 index 4cb31437c7e2..000000000000 --- a/samples/client/petstore/python-legacy/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/Pet.md b/samples/client/petstore/python-legacy/docs/Pet.md deleted file mode 100644 index c462e794c89a..000000000000 --- a/samples/client/petstore/python-legacy/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **str** | | -**photo_urls** | **list[str]** | | -**tags** | [**list[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/PetApi.md b/samples/client/petstore/python-legacy/docs/PetApi.md deleted file mode 100644 index e8176632d088..000000000000 --- a/samples/client/petstore/python-legacy/docs/PetApi.md +++ /dev/null @@ -1,681 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(body) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Add a new pet to the store - api_instance.add_pet(body) - except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id, api_key=api_key) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) - - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> list[Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - status = ['status_example'] # list[str] | Status values that need to be considered for filter - - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> list[Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - tags = ['tags_example'] # list[str] | Tags to filter by - - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**list[str]**](str.md)| Tags to filter by | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to return - - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(body) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Update an existing pet - api_instance.update_pet(body) - except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id, name=name, status=status) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) -status = 'status_example' # str | Updated status of the pet (optional) - - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -file = '/path/to/file' # file | file to upload (optional) - - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -required_file = '/path/to/file' # file | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md b/samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md deleted file mode 100644 index 53b4c61d8445..000000000000 --- a/samples/client/petstore/python-legacy/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/SpecialModelName.md b/samples/client/petstore/python-legacy/docs/SpecialModelName.md deleted file mode 100644 index 268e1134192d..000000000000 --- a/samples/client/petstore/python-legacy/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/StoreApi.md b/samples/client/petstore/python-legacy/docs/StoreApi.md deleted file mode 100644 index 832ed33acca8..000000000000 --- a/samples/client/petstore/python-legacy/docs/StoreApi.md +++ /dev/null @@ -1,268 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 'order_id_example' # str | ID of the order that needs to be deleted - - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> dict[str, int] get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**dict[str, int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 56 # int | ID of pet that needs to be fetched - - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(body) - -Place an order for a pet - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - body = petstore_api.Order() # Order | order placed for purchasing the pet - - try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/Tag.md b/samples/client/petstore/python-legacy/docs/Tag.md deleted file mode 100644 index 4ccac4949afc..000000000000 --- a/samples/client/petstore/python-legacy/docs/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/TypeHolderDefault.md b/samples/client/petstore/python-legacy/docs/TypeHolderDefault.md deleted file mode 100644 index 13d283006304..000000000000 --- a/samples/client/petstore/python-legacy/docs/TypeHolderDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# TypeHolderDefault - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | [default to True] -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/TypeHolderExample.md b/samples/client/petstore/python-legacy/docs/TypeHolderExample.md deleted file mode 100644 index f75bdd36f647..000000000000 --- a/samples/client/petstore/python-legacy/docs/TypeHolderExample.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeHolderExample - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | -**number_item** | **float** | | -**float_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/User.md b/samples/client/petstore/python-legacy/docs/User.md deleted file mode 100644 index b0079f591b6e..000000000000 --- a/samples/client/petstore/python-legacy/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/docs/UserApi.md b/samples/client/petstore/python-legacy/docs/UserApi.md deleted file mode 100644 index 6cb9d1ec3849..000000000000 --- a/samples/client/petstore/python-legacy/docs/UserApi.md +++ /dev/null @@ -1,501 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(body) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = petstore_api.User() # User | Created user object - - try: - # Create user - api_instance.create_user(body) - except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be deleted - - try: - # Delete user - api_instance.delete_user(username) - except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - - try: - # Logs out current logged in user session - api_instance.logout_user() - except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | name that need to be deleted -body = petstore_api.User() # User | Updated user object - - try: - # Updated user - api_instance.update_user(username, body) - except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-legacy/docs/XmlItem.md b/samples/client/petstore/python-legacy/docs/XmlItem.md deleted file mode 100644 index acaadbdb5f78..000000000000 --- a/samples/client/petstore/python-legacy/docs/XmlItem.md +++ /dev/null @@ -1,39 +0,0 @@ -# XmlItem - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **str** | | [optional] -**attribute_number** | **float** | | [optional] -**attribute_integer** | **int** | | [optional] -**attribute_boolean** | **bool** | | [optional] -**wrapped_array** | **list[int]** | | [optional] -**name_string** | **str** | | [optional] -**name_number** | **float** | | [optional] -**name_integer** | **int** | | [optional] -**name_boolean** | **bool** | | [optional] -**name_array** | **list[int]** | | [optional] -**name_wrapped_array** | **list[int]** | | [optional] -**prefix_string** | **str** | | [optional] -**prefix_number** | **float** | | [optional] -**prefix_integer** | **int** | | [optional] -**prefix_boolean** | **bool** | | [optional] -**prefix_array** | **list[int]** | | [optional] -**prefix_wrapped_array** | **list[int]** | | [optional] -**namespace_string** | **str** | | [optional] -**namespace_number** | **float** | | [optional] -**namespace_integer** | **int** | | [optional] -**namespace_boolean** | **bool** | | [optional] -**namespace_array** | **list[int]** | | [optional] -**namespace_wrapped_array** | **list[int]** | | [optional] -**prefix_ns_string** | **str** | | [optional] -**prefix_ns_number** | **float** | | [optional] -**prefix_ns_integer** | **int** | | [optional] -**prefix_ns_boolean** | **bool** | | [optional] -**prefix_ns_array** | **list[int]** | | [optional] -**prefix_ns_wrapped_array** | **list[int]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-legacy/git_push.sh b/samples/client/petstore/python-legacy/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/python-legacy/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/python-legacy/petstore_api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/__init__.py deleted file mode 100644 index 62a0d6bb97f5..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/__init__.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - -# import ApiClient -from petstore_api.api_client import ApiClient -from petstore_api.configuration import Configuration -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiException -# import models into sdk package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem - diff --git a/samples/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/api/__init__.py deleted file mode 100644 index ea4a9e3acb7d..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py deleted file mode 100644 index 8719c9511f17..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def call_123_test_special_tags(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 - - def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method call_123_test_special_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py deleted file mode 100644 index 7eae03dd24ec..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2230 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_xml_item(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 - - def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'xml_item' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_xml_item" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'xml_item' in local_var_params: - body_params = local_var_params['xml_item'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/create_xml_item', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bool - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_boolean_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "bool", - } - - return self.api_client.call_api( - '/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: OuterComposite - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_composite_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "OuterComposite", - } - - return self.api_client.call_api( - '/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: float - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_number_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "float", - } - - return self.api_client.call_api( - '/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_string_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - } - - return self.api_client.call_api( - '/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_file_schema(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 - - def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_file_schema" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-file-schema', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 - - def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'query', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_query_params" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query' is set - if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query') is not None: # noqa: E501 - query_params.append(('query', local_var_params['query'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-query-params', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 - - def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_client_model" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'number' is set - if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'double' is set - if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 - raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 - raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) > 64): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) < 10): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'integer' in local_var_params: - form_params.append(('integer', local_var_params['integer'])) # noqa: E501 - if 'int32' in local_var_params: - form_params.append(('int32', local_var_params['int32'])) # noqa: E501 - if 'int64' in local_var_params: - form_params.append(('int64', local_var_params['int64'])) # noqa: E501 - if 'number' in local_var_params: - form_params.append(('number', local_var_params['number'])) # noqa: E501 - if 'float' in local_var_params: - form_params.append(('float', local_var_params['float'])) # noqa: E501 - if 'double' in local_var_params: - form_params.append(('double', local_var_params['double'])) # noqa: E501 - if 'string' in local_var_params: - form_params.append(('string', local_var_params['string'])) # noqa: E501 - if 'pattern_without_delimiter' in local_var_params: - form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 - if 'byte' in local_var_params: - form_params.append(('byte', local_var_params['byte'])) # noqa: E501 - if 'binary' in local_var_params: - local_var_files['binary'] = local_var_params['binary'] # noqa: E501 - if 'date' in local_var_params: - form_params.append(('date', local_var_params['date'])) # noqa: E501 - if 'date_time' in local_var_params: - form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 - if 'password' in local_var_params: - form_params.append(('password', local_var_params['password'])) # noqa: E501 - if 'param_callback' in local_var_params: - form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_basic_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - - def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters_with_http_info(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_enum_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 - query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 - collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if local_var_params.get('enum_query_string') is not None: # noqa: E501 - query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if local_var_params.get('enum_query_integer') is not None: # noqa: E501 - query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if local_var_params.get('enum_query_double') is not None: # noqa: E501 - query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'enum_header_string_array' in local_var_params: - header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 - collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 - if 'enum_header_string' in local_var_params: - header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 - - form_params = [] - local_var_files = {} - if 'enum_form_string_array' in local_var_params: - form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 - collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 - if 'enum_form_string' in local_var_params: - form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - - def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_group_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('required_string_group') is not None: # noqa: E501 - query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if local_var_params.get('required_int64_group') is not None: # noqa: E501 - query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if local_var_params.get('string_group') is not None: # noqa: E501 - query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if local_var_params.get('int64_group') is not None: # noqa: E501 - query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'required_boolean_group' in local_var_params: - header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 - if 'boolean_group' in local_var_params: - header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 - - def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_inline_additional_properties" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'param' in local_var_params: - body_params = local_var_params['param'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - - def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param', - 'param2' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_json_form_data" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 - # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'param' in local_var_params: - form_params.append(('param', local_var_params['param'])) # noqa: E501 - if 'param2' in local_var_params: - form_params.append(('param2', local_var_params['param2'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 - - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_query_parameter_collection_format" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'http' is set - if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'url' is set - if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'context' is set - if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('pipe') is not None: # noqa: E501 - query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 - collection_formats['pipe'] = 'csv' # noqa: E501 - if local_var_params.get('ioutil') is not None: # noqa: E501 - query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 - collection_formats['ioutil'] = 'csv' # noqa: E501 - if local_var_params.get('http') is not None: # noqa: E501 - query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 - if local_var_params.get('url') is not None: # noqa: E501 - query_params.append(('url', local_var_params['url'])) # noqa: E501 - collection_formats['url'] = 'csv' # noqa: E501 - if local_var_params.get('context') is not None: # noqa: E501 - query_params.append(('context', local_var_params['context'])) # noqa: E501 - collection_formats['context'] = 'multi' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/test-query-parameters', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index 7dd05dd2d3dc..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index b5cd8cd22c94..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py deleted file mode 100644 index b2cf9e3641cd..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1332 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_pet(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 - - def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - - def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'api_key' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - if 'api_key' in local_var_params: - header_params['api_key'] = local_var_params['api_key'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - - def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_status" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('status') is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 - collection_formats['status'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - - def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'tags' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('tags') is not None: # noqa: E501 - query_params.append(('tags', local_var_params['tags'])) # noqa: E501 - collection_formats['tags'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Pet - """ - kwargs['_return_http_data_only'] = True - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "Pet", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 - - def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'name', - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet_with_form" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'name' in local_var_params: - form_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'status' in local_var_params: - form_params.append(('status', local_var_params['status'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 - - def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'additional_metadata', - 'file' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - - def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'required_file', - 'additional_metadata' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file_with_required_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 - # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'required_file' in local_var_params: - local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/fake/{petId}/uploadImageWithRequiredFile', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py deleted file mode 100644 index 17b8b851cfce..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py +++ /dev/null @@ -1,574 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - - def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: dict[str, int] - """ - kwargs['_return_http_data_only'] = True - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 - - def get_inventory_with_http_info(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_inventory" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "dict[str, int]", - } - - return self.api_client.call_api( - '/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - - def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_order_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def place_order(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.place_order_with_http_info(body, **kwargs) # noqa: E501 - - def place_order_with_http_info(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - } - - return self.api_client.call_api( - '/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py deleted file mode 100644 index 29e66939d737..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py +++ /dev/null @@ -1,1100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_user(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_user_with_http_info(body, **kwargs) # noqa: E501 - - def create_user_with_http_info(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_array_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_array_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_list_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_list_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - - def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - - def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "User", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - - def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user_with_http_info(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'password' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 - # verify the required parameter 'password' is set - if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('username') is not None: # noqa: E501 - query_params.append(('username', local_var_params['username'])) # noqa: E501 - if local_var_params.get('password') is not None: # noqa: E501 - query_params.append(('password', local_var_params['password'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - 400: None, - } - - return self.api_client.call_api( - '/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.logout_user_with_http_info(**kwargs) # noqa: E501 - - def logout_user_with_http_info(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_user(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 - - def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_with_http_info(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/petstore_api/api_client.py b/samples/client/petstore/python-legacy/petstore_api/api_client.py deleted file mode 100644 index 294f6f87c73c..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/api_client.py +++ /dev/null @@ -1,701 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote - -from petstore_api.configuration import Configuration -import petstore_api.models -from petstore_api import rest -from petstore_api.exceptions import ApiValueError, ApiException - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return return_data - - response_type = response_types_map.get(response_data.status, None) - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict['): - sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(petstore_api.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, queries, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) - - def _apply_auth_params(self, headers, queries, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - kwargs["local_vars_configuration"] = self.configuration - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/samples/client/petstore/python-legacy/petstore_api/configuration.py b/samples/client/petstore/python-legacy/petstore_api/configuration.py deleted file mode 100644 index 4f00d6d3c79a..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/configuration.py +++ /dev/null @@ -1,522 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -import six -from six.moves import http_client as httplib -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.access_token = None - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://petstore.swagger.io:80/v2", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/client/petstore/python-legacy/petstore_api/exceptions.py b/samples/client/petstore/python-legacy/petstore_api/exceptions.py deleted file mode 100644 index 08181d4775db..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/exceptions.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/client/petstore/python-legacy/petstore_api/models/__init__.py deleted file mode 100644 index ddef3dea4fdb..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py deleted file mode 100644 index 01457faa3a33..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_any_type.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesAnyType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesAnyType. # noqa: E501 - - - :return: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesAnyType. - - - :param name: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py deleted file mode 100644 index c7283e161360..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_array.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesArray(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesArray. # noqa: E501 - - - :return: The name of this AdditionalPropertiesArray. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesArray. - - - :param name: The name of this AdditionalPropertiesArray. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesArray): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesArray): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py deleted file mode 100644 index 3a8ec8f66aac..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_boolean.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesBoolean(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesBoolean. # noqa: E501 - - - :return: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesBoolean. - - - :param name: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py deleted file mode 100644 index b561f467d21e..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py +++ /dev/null @@ -1,391 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_string': 'dict[str, str]', - 'map_number': 'dict[str, float]', - 'map_integer': 'dict[str, int]', - 'map_boolean': 'dict[str, bool]', - 'map_array_integer': 'dict[str, list[int]]', - 'map_array_anytype': 'dict[str, list[object]]', - 'map_map_string': 'dict[str, dict[str, str]]', - 'map_map_anytype': 'dict[str, dict[str, object]]', - 'anytype_1': 'object', - 'anytype_2': 'object', - 'anytype_3': 'object' - } - - attribute_map = { - 'map_string': 'map_string', - 'map_number': 'map_number', - 'map_integer': 'map_integer', - 'map_boolean': 'map_boolean', - 'map_array_integer': 'map_array_integer', - 'map_array_anytype': 'map_array_anytype', - 'map_map_string': 'map_map_string', - 'map_map_anytype': 'map_map_anytype', - 'anytype_1': 'anytype_1', - 'anytype_2': 'anytype_2', - 'anytype_3': 'anytype_3' - } - - def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_string = None - self._map_number = None - self._map_integer = None - self._map_boolean = None - self._map_array_integer = None - self._map_array_anytype = None - self._map_map_string = None - self._map_map_anytype = None - self._anytype_1 = None - self._anytype_2 = None - self._anytype_3 = None - self.discriminator = None - - if map_string is not None: - self.map_string = map_string - if map_number is not None: - self.map_number = map_number - if map_integer is not None: - self.map_integer = map_integer - if map_boolean is not None: - self.map_boolean = map_boolean - if map_array_integer is not None: - self.map_array_integer = map_array_integer - if map_array_anytype is not None: - self.map_array_anytype = map_array_anytype - if map_map_string is not None: - self.map_map_string = map_map_string - if map_map_anytype is not None: - self.map_map_anytype = map_map_anytype - if anytype_1 is not None: - self.anytype_1 = anytype_1 - if anytype_2 is not None: - self.anytype_2 = anytype_2 - if anytype_3 is not None: - self.anytype_3 = anytype_3 - - @property - def map_string(self): - """Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_string - - @map_string.setter - def map_string(self, map_string): - """Sets the map_string of this AdditionalPropertiesClass. - - - :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_string: dict[str, str] - """ - - self._map_string = map_string - - @property - def map_number(self): - """Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, float] - """ - return self._map_number - - @map_number.setter - def map_number(self, map_number): - """Sets the map_number of this AdditionalPropertiesClass. - - - :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :type map_number: dict[str, float] - """ - - self._map_number = map_number - - @property - def map_integer(self): - """Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, int] - """ - return self._map_integer - - @map_integer.setter - def map_integer(self, map_integer): - """Sets the map_integer of this AdditionalPropertiesClass. - - - :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_integer: dict[str, int] - """ - - self._map_integer = map_integer - - @property - def map_boolean(self): - """Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._map_boolean - - @map_boolean.setter - def map_boolean(self, map_boolean): - """Sets the map_boolean of this AdditionalPropertiesClass. - - - :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :type map_boolean: dict[str, bool] - """ - - self._map_boolean = map_boolean - - @property - def map_array_integer(self): - """Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[int]] - """ - return self._map_array_integer - - @map_array_integer.setter - def map_array_integer(self, map_array_integer): - """Sets the map_array_integer of this AdditionalPropertiesClass. - - - :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_integer: dict[str, list[int]] - """ - - self._map_array_integer = map_array_integer - - @property - def map_array_anytype(self): - """Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[object]] - """ - return self._map_array_anytype - - @map_array_anytype.setter - def map_array_anytype(self, map_array_anytype): - """Sets the map_array_anytype of this AdditionalPropertiesClass. - - - :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_anytype: dict[str, list[object]] - """ - - self._map_array_anytype = map_array_anytype - - @property - def map_map_string(self): - """Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_string - - @map_map_string.setter - def map_map_string(self, map_map_string): - """Sets the map_map_string of this AdditionalPropertiesClass. - - - :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_string: dict[str, dict[str, str]] - """ - - self._map_map_string = map_map_string - - @property - def map_map_anytype(self): - """Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, object]] - """ - return self._map_map_anytype - - @map_map_anytype.setter - def map_map_anytype(self, map_map_anytype): - """Sets the map_map_anytype of this AdditionalPropertiesClass. - - - :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_anytype: dict[str, dict[str, object]] - """ - - self._map_map_anytype = map_map_anytype - - @property - def anytype_1(self): - """Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_1 - - @anytype_1.setter - def anytype_1(self, anytype_1): - """Sets the anytype_1 of this AdditionalPropertiesClass. - - - :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_1: object - """ - - self._anytype_1 = anytype_1 - - @property - def anytype_2(self): - """Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_2 - - @anytype_2.setter - def anytype_2(self, anytype_2): - """Sets the anytype_2 of this AdditionalPropertiesClass. - - - :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_2: object - """ - - self._anytype_2 = anytype_2 - - @property - def anytype_3(self): - """Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_3 - - @anytype_3.setter - def anytype_3(self, anytype_3): - """Sets the anytype_3 of this AdditionalPropertiesClass. - - - :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_3: object - """ - - self._anytype_3 = anytype_3 - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py deleted file mode 100644 index d9ee889d7a33..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_integer.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesInteger(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesInteger. # noqa: E501 - - - :return: The name of this AdditionalPropertiesInteger. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesInteger. - - - :param name: The name of this AdditionalPropertiesInteger. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py deleted file mode 100644 index 756fc037970f..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_number.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesNumber(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesNumber. # noqa: E501 - - - :return: The name of this AdditionalPropertiesNumber. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesNumber. - - - :param name: The name of this AdditionalPropertiesNumber. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py deleted file mode 100644 index bfbe2db1bef9..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_object.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesObject. # noqa: E501 - - - :return: The name of this AdditionalPropertiesObject. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesObject. - - - :param name: The name of this AdditionalPropertiesObject. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesObject): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesObject): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py deleted file mode 100644 index 7c33a16fe8fc..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_string.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesString(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesString. # noqa: E501 - - - :return: The name of this AdditionalPropertiesString. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesString. - - - :param name: The name of this AdditionalPropertiesString. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesString): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesString): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/animal.py b/samples/client/petstore/python-legacy/petstore_api/models/animal.py deleted file mode 100644 index 335eb2625af4..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/animal.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Animal(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'class_name': 'str', - 'color': 'str' - } - - attribute_map = { - 'class_name': 'className', - 'color': 'color' - } - - discriminator_value_class_map = { - 'BigCat': 'BigCat', - 'Cat': 'Cat', - 'Dog': 'Dog' - } - - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 - """Animal - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._class_name = None - self._color = None - self.discriminator = 'class_name' - - self.class_name = class_name - if color is not None: - self.color = color - - @property - def class_name(self): - """Gets the class_name of this Animal. # noqa: E501 - - - :return: The class_name of this Animal. # noqa: E501 - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """Sets the class_name of this Animal. - - - :param class_name: The class_name of this Animal. # noqa: E501 - :type class_name: str - """ - if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 - raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 - - self._class_name = class_name - - @property - def color(self): - """Gets the color of this Animal. # noqa: E501 - - - :return: The color of this Animal. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this Animal. - - - :param color: The color of this Animal. # noqa: E501 - :type color: str - """ - - self._color = color - - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Animal): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Animal): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/api_response.py b/samples/client/petstore/python-legacy/petstore_api/models/api_response.py deleted file mode 100644 index bddac1eb10a3..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/api_response.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ApiResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str' - } - - attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } - - def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._type = None - self._message = None - self.discriminator = None - - if code is not None: - self.code = code - if type is not None: - self.type = type - if message is not None: - self.message = message - - @property - def code(self): - """Gets the code of this ApiResponse. # noqa: E501 - - - :return: The code of this ApiResponse. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this ApiResponse. - - - :param code: The code of this ApiResponse. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def type(self): - """Gets the type of this ApiResponse. # noqa: E501 - - - :return: The type of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this ApiResponse. - - - :param type: The type of this ApiResponse. # noqa: E501 - :type type: str - """ - - self._type = type - - @property - def message(self): - """Gets the message of this ApiResponse. # noqa: E501 - - - :return: The message of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this ApiResponse. - - - :param message: The message of this ApiResponse. # noqa: E501 - :type message: str - """ - - self._message = message - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ApiResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ApiResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py deleted file mode 100644 index 2975adc20e31..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_array_number': 'list[list[float]]' - } - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber' - } - - def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_array_number = None - self.discriminator = None - - if array_array_number is not None: - self.array_array_number = array_array_number - - @property - def array_array_number(self): - """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - - - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :rtype: list[list[float]] - """ - return self._array_array_number - - @array_array_number.setter - def array_array_number(self, array_array_number): - """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. - - - :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :type array_array_number: list[list[float]] - """ - - self._array_array_number = array_array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py deleted file mode 100644 index 2a3400e76660..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_number': 'list[float]' - } - - attribute_map = { - 'array_number': 'ArrayNumber' - } - - def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_number = None - self.discriminator = None - - if array_number is not None: - self.array_number = array_number - - @property - def array_number(self): - """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - - - :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :rtype: list[float] - """ - return self._array_number - - @array_number.setter - def array_number(self, array_number): - """Sets the array_number of this ArrayOfNumberOnly. - - - :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :type array_number: list[float] - """ - - self._array_number = array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/array_test.py b/samples/client/petstore/python-legacy/petstore_api/models/array_test.py deleted file mode 100644 index 11394dcb7bc1..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/array_test.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' - } - - attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' - } - - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_of_string = None - self._array_array_of_integer = None - self._array_array_of_model = None - self.discriminator = None - - if array_of_string is not None: - self.array_of_string = array_of_string - if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer - if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model - - @property - def array_of_string(self): - """Gets the array_of_string of this ArrayTest. # noqa: E501 - - - :return: The array_of_string of this ArrayTest. # noqa: E501 - :rtype: list[str] - """ - return self._array_of_string - - @array_of_string.setter - def array_of_string(self, array_of_string): - """Sets the array_of_string of this ArrayTest. - - - :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 - :type array_of_string: list[str] - """ - - self._array_of_string = array_of_string - - @property - def array_array_of_integer(self): - """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_integer of this ArrayTest. # noqa: E501 - :rtype: list[list[int]] - """ - return self._array_array_of_integer - - @array_array_of_integer.setter - def array_array_of_integer(self, array_array_of_integer): - """Sets the array_array_of_integer of this ArrayTest. - - - :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 - :type array_array_of_integer: list[list[int]] - """ - - self._array_array_of_integer = array_array_of_integer - - @property - def array_array_of_model(self): - """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_model of this ArrayTest. # noqa: E501 - :rtype: list[list[ReadOnlyFirst]] - """ - return self._array_array_of_model - - @array_array_of_model.setter - def array_array_of_model(self, array_array_of_model): - """Sets the array_array_of_model of this ArrayTest. - - - :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 - :type array_array_of_model: list[list[ReadOnlyFirst]] - """ - - self._array_array_of_model = array_array_of_model - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/big_cat.py b/samples/client/petstore/python-legacy/petstore_api/models/big_cat.py deleted file mode 100644 index 9a108ce3717e..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/big_cat.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCat. # noqa: E501 - - - :return: The kind of this BigCat. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCat. - - - :param kind: The kind of this BigCat. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py deleted file mode 100644 index 6d6c9aeb5c0c..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/big_cat_all_of.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCatAllOf. # noqa: E501 - - - :return: The kind of this BigCatAllOf. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCatAllOf. - - - :param kind: The kind of this BigCatAllOf. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/capitalization.py b/samples/client/petstore/python-legacy/petstore_api/models/capitalization.py deleted file mode 100644 index cb8b0d985842..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/capitalization.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Capitalization(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str' - } - - attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' - } - - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._small_camel = None - self._capital_camel = None - self._small_snake = None - self._capital_snake = None - self._sca_eth_flow_points = None - self._att_name = None - self.discriminator = None - - if small_camel is not None: - self.small_camel = small_camel - if capital_camel is not None: - self.capital_camel = capital_camel - if small_snake is not None: - self.small_snake = small_snake - if capital_snake is not None: - self.capital_snake = capital_snake - if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points - if att_name is not None: - self.att_name = att_name - - @property - def small_camel(self): - """Gets the small_camel of this Capitalization. # noqa: E501 - - - :return: The small_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_camel - - @small_camel.setter - def small_camel(self, small_camel): - """Sets the small_camel of this Capitalization. - - - :param small_camel: The small_camel of this Capitalization. # noqa: E501 - :type small_camel: str - """ - - self._small_camel = small_camel - - @property - def capital_camel(self): - """Gets the capital_camel of this Capitalization. # noqa: E501 - - - :return: The capital_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_camel - - @capital_camel.setter - def capital_camel(self, capital_camel): - """Sets the capital_camel of this Capitalization. - - - :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 - :type capital_camel: str - """ - - self._capital_camel = capital_camel - - @property - def small_snake(self): - """Gets the small_snake of this Capitalization. # noqa: E501 - - - :return: The small_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_snake - - @small_snake.setter - def small_snake(self, small_snake): - """Sets the small_snake of this Capitalization. - - - :param small_snake: The small_snake of this Capitalization. # noqa: E501 - :type small_snake: str - """ - - self._small_snake = small_snake - - @property - def capital_snake(self): - """Gets the capital_snake of this Capitalization. # noqa: E501 - - - :return: The capital_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_snake - - @capital_snake.setter - def capital_snake(self, capital_snake): - """Sets the capital_snake of this Capitalization. - - - :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 - :type capital_snake: str - """ - - self._capital_snake = capital_snake - - @property - def sca_eth_flow_points(self): - """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - - - :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._sca_eth_flow_points - - @sca_eth_flow_points.setter - def sca_eth_flow_points(self, sca_eth_flow_points): - """Sets the sca_eth_flow_points of this Capitalization. - - - :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :type sca_eth_flow_points: str - """ - - self._sca_eth_flow_points = sca_eth_flow_points - - @property - def att_name(self): - """Gets the att_name of this Capitalization. # noqa: E501 - - Name of the pet # noqa: E501 - - :return: The att_name of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._att_name - - @att_name.setter - def att_name(self, att_name): - """Sets the att_name of this Capitalization. - - Name of the pet # noqa: E501 - - :param att_name: The att_name of this Capitalization. # noqa: E501 - :type att_name: str - """ - - self._att_name = att_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Capitalization): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Capitalization): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/cat.py b/samples/client/petstore/python-legacy/petstore_api/models/cat.py deleted file mode 100644 index 0d9a0b20bf1a..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/cat.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Cat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """Cat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this Cat. # noqa: E501 - - - :return: The declawed of this Cat. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this Cat. - - - :param declawed: The declawed of this Cat. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Cat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Cat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py deleted file mode 100644 index 0633bbf58d0d..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/cat_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class CatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this CatAllOf. # noqa: E501 - - - :return: The declawed of this CatAllOf. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this CatAllOf. - - - :param declawed: The declawed of this CatAllOf. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/category.py b/samples/client/petstore/python-legacy/petstore_api/models/category.py deleted file mode 100644 index ef52dcbf8c91..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/category.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Category(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 - """Category - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - - @property - def id(self): - """Gets the id of this Category. # noqa: E501 - - - :return: The id of this Category. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Category. - - - :param id: The id of this Category. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Category. # noqa: E501 - - - :return: The name of this Category. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Category. - - - :param name: The name of this Category. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Category): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Category): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/class_model.py b/samples/client/petstore/python-legacy/petstore_api/models/class_model.py deleted file mode 100644 index 84c0de65b472..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/class_model.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ClassModel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_class': 'str' - } - - attribute_map = { - '_class': '_class' - } - - def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__class = None - self.discriminator = None - - if _class is not None: - self._class = _class - - @property - def _class(self): - """Gets the _class of this ClassModel. # noqa: E501 - - - :return: The _class of this ClassModel. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this ClassModel. - - - :param _class: The _class of this ClassModel. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ClassModel): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ClassModel): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/client.py b/samples/client/petstore/python-legacy/petstore_api/models/client.py deleted file mode 100644 index 8d7c83ecfe6b..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/client.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Client(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'client': 'str' - } - - attribute_map = { - 'client': 'client' - } - - def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 - """Client - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._client = None - self.discriminator = None - - if client is not None: - self.client = client - - @property - def client(self): - """Gets the client of this Client. # noqa: E501 - - - :return: The client of this Client. # noqa: E501 - :rtype: str - """ - return self._client - - @client.setter - def client(self, client): - """Sets the client of this Client. - - - :param client: The client of this Client. # noqa: E501 - :type client: str - """ - - self._client = client - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Client): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Client): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/dog.py b/samples/client/petstore/python-legacy/petstore_api/models/dog.py deleted file mode 100644 index 61acd35cdfe2..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/dog.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Dog(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """Dog - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this Dog. # noqa: E501 - - - :return: The breed of this Dog. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this Dog. - - - :param breed: The breed of this Dog. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dog): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Dog): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py deleted file mode 100644 index 3a052c3258ae..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/dog_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class DogAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this DogAllOf. # noqa: E501 - - - :return: The breed of this DogAllOf. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this DogAllOf. - - - :param breed: The breed of this DogAllOf. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DogAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DogAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py deleted file mode 100644 index eb4f3ea4ca32..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/enum_arrays.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumArrays(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]' - } - - attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' - } - - def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_symbol = None - self._array_enum = None - self.discriminator = None - - if just_symbol is not None: - self.just_symbol = just_symbol - if array_enum is not None: - self.array_enum = array_enum - - @property - def just_symbol(self): - """Gets the just_symbol of this EnumArrays. # noqa: E501 - - - :return: The just_symbol of this EnumArrays. # noqa: E501 - :rtype: str - """ - return self._just_symbol - - @just_symbol.setter - def just_symbol(self, just_symbol): - """Sets the just_symbol of this EnumArrays. - - - :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 - :type just_symbol: str - """ - allowed_values = [">=", "$"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 - .format(just_symbol, allowed_values) - ) - - self._just_symbol = just_symbol - - @property - def array_enum(self): - """Gets the array_enum of this EnumArrays. # noqa: E501 - - - :return: The array_enum of this EnumArrays. # noqa: E501 - :rtype: list[str] - """ - return self._array_enum - - @array_enum.setter - def array_enum(self, array_enum): - """Sets the array_enum of this EnumArrays. - - - :param array_enum: The array_enum of this EnumArrays. # noqa: E501 - :type array_enum: list[str] - """ - allowed_values = ["fish", "crab"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(array_enum).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._array_enum = array_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumArrays): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumArrays): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/enum_class.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_class.py deleted file mode 100644 index 79aac3570cb9..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/enum_class.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _ABC = "_abc" - _EFG = "-efg" - _XYZ_ = "(xyz)" - - allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """EnumClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/enum_test.py b/samples/client/petstore/python-legacy/petstore_api/models/enum_test.py deleted file mode 100644 index 1f3d7cb29b89..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/enum_test.py +++ /dev/null @@ -1,260 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'enum_string': 'str', - 'enum_string_required': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum' - } - - attribute_map = { - 'enum_string': 'enum_string', - 'enum_string_required': 'enum_string_required', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum' - } - - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._enum_string = None - self._enum_string_required = None - self._enum_integer = None - self._enum_number = None - self._outer_enum = None - self.discriminator = None - - if enum_string is not None: - self.enum_string = enum_string - self.enum_string_required = enum_string_required - if enum_integer is not None: - self.enum_integer = enum_integer - if enum_number is not None: - self.enum_number = enum_number - if outer_enum is not None: - self.outer_enum = outer_enum - - @property - def enum_string(self): - """Gets the enum_string of this EnumTest. # noqa: E501 - - - :return: The enum_string of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string - - @enum_string.setter - def enum_string(self, enum_string): - """Sets the enum_string of this EnumTest. - - - :param enum_string: The enum_string of this EnumTest. # noqa: E501 - :type enum_string: str - """ - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string, allowed_values) - ) - - self._enum_string = enum_string - - @property - def enum_string_required(self): - """Gets the enum_string_required of this EnumTest. # noqa: E501 - - - :return: The enum_string_required of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string_required - - @enum_string_required.setter - def enum_string_required(self, enum_string_required): - """Sets the enum_string_required of this EnumTest. - - - :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 - :type enum_string_required: str - """ - if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 - raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string_required, allowed_values) - ) - - self._enum_string_required = enum_string_required - - @property - def enum_integer(self): - """Gets the enum_integer of this EnumTest. # noqa: E501 - - - :return: The enum_integer of this EnumTest. # noqa: E501 - :rtype: int - """ - return self._enum_integer - - @enum_integer.setter - def enum_integer(self, enum_integer): - """Sets the enum_integer of this EnumTest. - - - :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 - :type enum_integer: int - """ - allowed_values = [1, -1] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 - .format(enum_integer, allowed_values) - ) - - self._enum_integer = enum_integer - - @property - def enum_number(self): - """Gets the enum_number of this EnumTest. # noqa: E501 - - - :return: The enum_number of this EnumTest. # noqa: E501 - :rtype: float - """ - return self._enum_number - - @enum_number.setter - def enum_number(self, enum_number): - """Sets the enum_number of this EnumTest. - - - :param enum_number: The enum_number of this EnumTest. # noqa: E501 - :type enum_number: float - """ - allowed_values = [1.1, -1.2] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 - .format(enum_number, allowed_values) - ) - - self._enum_number = enum_number - - @property - def outer_enum(self): - """Gets the outer_enum of this EnumTest. # noqa: E501 - - - :return: The outer_enum of this EnumTest. # noqa: E501 - :rtype: OuterEnum - """ - return self._outer_enum - - @outer_enum.setter - def outer_enum(self, outer_enum): - """Sets the outer_enum of this EnumTest. - - - :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 - :type outer_enum: OuterEnum - """ - - self._outer_enum = outer_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/file.py b/samples/client/petstore/python-legacy/petstore_api/models/file.py deleted file mode 100644 index 2c1cccac0e11..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/file.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class File(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'source_uri': 'str' - } - - attribute_map = { - 'source_uri': 'sourceURI' - } - - def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 - """File - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._source_uri = None - self.discriminator = None - - if source_uri is not None: - self.source_uri = source_uri - - @property - def source_uri(self): - """Gets the source_uri of this File. # noqa: E501 - - Test capitalization # noqa: E501 - - :return: The source_uri of this File. # noqa: E501 - :rtype: str - """ - return self._source_uri - - @source_uri.setter - def source_uri(self, source_uri): - """Sets the source_uri of this File. - - Test capitalization # noqa: E501 - - :param source_uri: The source_uri of this File. # noqa: E501 - :type source_uri: str - """ - - self._source_uri = source_uri - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, File): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, File): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py deleted file mode 100644 index c5a23842d4f6..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FileSchemaTestClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'file': 'File', - 'files': 'list[File]' - } - - attribute_map = { - 'file': 'file', - 'files': 'files' - } - - def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._file = None - self._files = None - self.discriminator = None - - if file is not None: - self.file = file - if files is not None: - self.files = files - - @property - def file(self): - """Gets the file of this FileSchemaTestClass. # noqa: E501 - - - :return: The file of this FileSchemaTestClass. # noqa: E501 - :rtype: File - """ - return self._file - - @file.setter - def file(self, file): - """Sets the file of this FileSchemaTestClass. - - - :param file: The file of this FileSchemaTestClass. # noqa: E501 - :type file: File - """ - - self._file = file - - @property - def files(self): - """Gets the files of this FileSchemaTestClass. # noqa: E501 - - - :return: The files of this FileSchemaTestClass. # noqa: E501 - :rtype: list[File] - """ - return self._files - - @files.setter - def files(self, files): - """Sets the files of this FileSchemaTestClass. - - - :param files: The files of this FileSchemaTestClass. # noqa: E501 - :type files: list[File] - """ - - self._files = files - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FileSchemaTestClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FileSchemaTestClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/format_test.py b/samples/client/petstore/python-legacy/petstore_api/models/format_test.py deleted file mode 100644 index 452582251a59..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/format_test.py +++ /dev/null @@ -1,515 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FormatTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'byte': 'str', - 'binary': 'file', - 'date': 'date', - 'date_time': 'datetime', - 'uuid': 'str', - 'password': 'str', - 'big_decimal': 'Decimal' - } - - attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password', - 'big_decimal': 'BigDecimal' - } - - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None, local_vars_configuration=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer = None - self._int32 = None - self._int64 = None - self._number = None - self._float = None - self._double = None - self._string = None - self._byte = None - self._binary = None - self._date = None - self._date_time = None - self._uuid = None - self._password = None - self._big_decimal = None - self.discriminator = None - - if integer is not None: - self.integer = integer - if int32 is not None: - self.int32 = int32 - if int64 is not None: - self.int64 = int64 - self.number = number - if float is not None: - self.float = float - if double is not None: - self.double = double - if string is not None: - self.string = string - self.byte = byte - if binary is not None: - self.binary = binary - self.date = date - if date_time is not None: - self.date_time = date_time - if uuid is not None: - self.uuid = uuid - self.password = password - if big_decimal is not None: - self.big_decimal = big_decimal - - @property - def integer(self): - """Gets the integer of this FormatTest. # noqa: E501 - - - :return: The integer of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this FormatTest. - - - :param integer: The integer of this FormatTest. # noqa: E501 - :type integer: int - """ - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer > 100): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer < 10): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - - self._integer = integer - - @property - def int32(self): - """Gets the int32 of this FormatTest. # noqa: E501 - - - :return: The int32 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int32 - - @int32.setter - def int32(self, int32): - """Sets the int32 of this FormatTest. - - - :param int32: The int32 of this FormatTest. # noqa: E501 - :type int32: int - """ - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 > 200): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 < 20): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - - self._int32 = int32 - - @property - def int64(self): - """Gets the int64 of this FormatTest. # noqa: E501 - - - :return: The int64 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int64 - - @int64.setter - def int64(self, int64): - """Sets the int64 of this FormatTest. - - - :param int64: The int64 of this FormatTest. # noqa: E501 - :type int64: int - """ - - self._int64 = int64 - - @property - def number(self): - """Gets the number of this FormatTest. # noqa: E501 - - - :return: The number of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this FormatTest. - - - :param number: The number of this FormatTest. # noqa: E501 - :type number: float - """ - if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number > 543.2): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number < 32.1): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - - self._number = number - - @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 - - - :return: The float of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._float - - @float.setter - def float(self, float): - """Sets the float of this FormatTest. - - - :param float: The float of this FormatTest. # noqa: E501 - :type float: float - """ - if (self.local_vars_configuration.client_side_validation and - float is not None and float > 987.6): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - float is not None and float < 54.3): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 - - self._float = float - - @property - def double(self): - """Gets the double of this FormatTest. # noqa: E501 - - - :return: The double of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._double - - @double.setter - def double(self, double): - """Sets the double of this FormatTest. - - - :param double: The double of this FormatTest. # noqa: E501 - :type double: float - """ - if (self.local_vars_configuration.client_side_validation and - double is not None and double > 123.4): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double < 67.8): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - - self._double = double - - @property - def string(self): - """Gets the string of this FormatTest. # noqa: E501 - - - :return: The string of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this FormatTest. - - - :param string: The string of this FormatTest. # noqa: E501 - :type string: str - """ - if (self.local_vars_configuration.client_side_validation and - string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - - self._string = string - - @property - def byte(self): - """Gets the byte of this FormatTest. # noqa: E501 - - - :return: The byte of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._byte - - @byte.setter - def byte(self, byte): - """Sets the byte of this FormatTest. - - - :param byte: The byte of this FormatTest. # noqa: E501 - :type byte: str - """ - if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501 - raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 - - self._byte = byte - - @property - def binary(self): - """Gets the binary of this FormatTest. # noqa: E501 - - - :return: The binary of this FormatTest. # noqa: E501 - :rtype: file - """ - return self._binary - - @binary.setter - def binary(self, binary): - """Sets the binary of this FormatTest. - - - :param binary: The binary of this FormatTest. # noqa: E501 - :type binary: file - """ - - self._binary = binary - - @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 - - - :return: The date of this FormatTest. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this FormatTest. - - - :param date: The date of this FormatTest. # noqa: E501 - :type date: date - """ - if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def date_time(self): - """Gets the date_time of this FormatTest. # noqa: E501 - - - :return: The date_time of this FormatTest. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this FormatTest. - - - :param date_time: The date_time of this FormatTest. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def uuid(self): - """Gets the uuid of this FormatTest. # noqa: E501 - - - :return: The uuid of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this FormatTest. - - - :param uuid: The uuid of this FormatTest. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def password(self): - """Gets the password of this FormatTest. # noqa: E501 - - - :return: The password of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this FormatTest. - - - :param password: The password of this FormatTest. # noqa: E501 - :type password: str - """ - if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) > 64): - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) < 10): - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - - self._password = password - - @property - def big_decimal(self): - """Gets the big_decimal of this FormatTest. # noqa: E501 - - - :return: The big_decimal of this FormatTest. # noqa: E501 - :rtype: Decimal - """ - return self._big_decimal - - @big_decimal.setter - def big_decimal(self, big_decimal): - """Sets the big_decimal of this FormatTest. - - - :param big_decimal: The big_decimal of this FormatTest. # noqa: E501 - :type big_decimal: Decimal - """ - - self._big_decimal = big_decimal - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FormatTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FormatTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py deleted file mode 100644 index 7175c2acc721..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class HasOnlyReadOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'foo': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'foo': 'foo' - } - - def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._foo = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if foo is not None: - self.foo = foo - - @property - def bar(self): - """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - - - :return: The bar of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this HasOnlyReadOnly. - - - :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def foo(self): - """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - - - :return: The foo of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._foo - - @foo.setter - def foo(self, foo): - """Sets the foo of this HasOnlyReadOnly. - - - :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 - :type foo: str - """ - - self._foo = foo - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HasOnlyReadOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, HasOnlyReadOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/list.py b/samples/client/petstore/python-legacy/petstore_api/models/list.py deleted file mode 100644 index 6e1dea4e33b5..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/list.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class List(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_123_list': 'str' - } - - attribute_map = { - '_123_list': '123-list' - } - - def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 - """List - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__123_list = None - self.discriminator = None - - if _123_list is not None: - self._123_list = _123_list - - @property - def _123_list(self): - """Gets the _123_list of this List. # noqa: E501 - - - :return: The _123_list of this List. # noqa: E501 - :rtype: str - """ - return self.__123_list - - @_123_list.setter - def _123_list(self, _123_list): - """Sets the _123_list of this List. - - - :param _123_list: The _123_list of this List. # noqa: E501 - :type _123_list: str - """ - - self.__123_list = _123_list - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, List): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, List): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/map_test.py b/samples/client/petstore/python-legacy/petstore_api/models/map_test.py deleted file mode 100644 index 606253a90d9e..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/map_test.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MapTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_map_of_string': 'dict[str, dict[str, str]]', - 'map_of_enum_string': 'dict[str, str]', - 'direct_map': 'dict[str, bool]', - 'indirect_map': 'dict[str, bool]' - } - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string', - 'direct_map': 'direct_map', - 'indirect_map': 'indirect_map' - } - - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 - """MapTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_map_of_string = None - self._map_of_enum_string = None - self._direct_map = None - self._indirect_map = None - self.discriminator = None - - if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string - if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string - if direct_map is not None: - self.direct_map = direct_map - if indirect_map is not None: - self.indirect_map = indirect_map - - @property - def map_map_of_string(self): - """Gets the map_map_of_string of this MapTest. # noqa: E501 - - - :return: The map_map_of_string of this MapTest. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_of_string - - @map_map_of_string.setter - def map_map_of_string(self, map_map_of_string): - """Sets the map_map_of_string of this MapTest. - - - :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 - :type map_map_of_string: dict[str, dict[str, str]] - """ - - self._map_map_of_string = map_map_of_string - - @property - def map_of_enum_string(self): - """Gets the map_of_enum_string of this MapTest. # noqa: E501 - - - :return: The map_of_enum_string of this MapTest. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_of_enum_string - - @map_of_enum_string.setter - def map_of_enum_string(self, map_of_enum_string): - """Sets the map_of_enum_string of this MapTest. - - - :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 - :type map_of_enum_string: dict[str, str] - """ - allowed_values = ["UPPER", "lower"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._map_of_enum_string = map_of_enum_string - - @property - def direct_map(self): - """Gets the direct_map of this MapTest. # noqa: E501 - - - :return: The direct_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._direct_map - - @direct_map.setter - def direct_map(self, direct_map): - """Sets the direct_map of this MapTest. - - - :param direct_map: The direct_map of this MapTest. # noqa: E501 - :type direct_map: dict[str, bool] - """ - - self._direct_map = direct_map - - @property - def indirect_map(self): - """Gets the indirect_map of this MapTest. # noqa: E501 - - - :return: The indirect_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._indirect_map - - @indirect_map.setter - def indirect_map(self, indirect_map): - """Sets the indirect_map of this MapTest. - - - :param indirect_map: The indirect_map of this MapTest. # noqa: E501 - :type indirect_map: dict[str, bool] - """ - - self._indirect_map = indirect_map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MapTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MapTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 96aedc145c40..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MixedPropertiesAndAdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict[str, Animal]' - } - - attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' - } - - def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._uuid = None - self._date_time = None - self._map = None - self.discriminator = None - - if uuid is not None: - self.uuid = uuid - if date_time is not None: - self.date_time = date_time - if map is not None: - self.map = map - - @property - def uuid(self): - """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def date_time(self): - """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def map(self): - """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, Animal] - """ - return self._map - - @map.setter - def map(self, map): - """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type map: dict[str, Animal] - """ - - self._map = map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/model200_response.py b/samples/client/petstore/python-legacy/petstore_api/models/model200_response.py deleted file mode 100644 index db587fd24e2f..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/model200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - - :return: The name of this Model200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model200Response. - - - :param name: The name of this Model200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - - :return: The _class of this Model200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model200Response. - - - :param _class: The _class of this Model200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/model_200_response.py b/samples/client/petstore/python-legacy/petstore_api/models/model_200_response.py deleted file mode 100644 index 96498ac6b1df..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/model_200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model_200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model_200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model_200Response. # noqa: E501 - - - :return: The name of this Model_200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model_200Response. - - - :param name: The name of this Model_200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model_200Response. # noqa: E501 - - - :return: The _class of this Model_200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model_200Response. - - - :param _class: The _class of this Model_200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model_200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model_200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/model_return.py b/samples/client/petstore/python-legacy/petstore_api/models/model_return.py deleted file mode 100644 index 5354fd56e2ce..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/model_return.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ModelReturn(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_return': 'int' - } - - attribute_map = { - '_return': 'return' - } - - def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__return = None - self.discriminator = None - - if _return is not None: - self._return = _return - - @property - def _return(self): - """Gets the _return of this ModelReturn. # noqa: E501 - - - :return: The _return of this ModelReturn. # noqa: E501 - :rtype: int - """ - return self.__return - - @_return.setter - def _return(self, _return): - """Sets the _return of this ModelReturn. - - - :param _return: The _return of this ModelReturn. # noqa: E501 - :type _return: int - """ - - self.__return = _return - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ModelReturn): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ModelReturn): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/name.py b/samples/client/petstore/python-legacy/petstore_api/models/name.py deleted file mode 100644 index 0191a3a934ae..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/name.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Name(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int' - } - - attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' - } - - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 - """Name - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._snake_case = None - self.__property = None - self.__123_number = None - self.discriminator = None - - self.name = name - if snake_case is not None: - self.snake_case = snake_case - if _property is not None: - self._property = _property - if _123_number is not None: - self._123_number = _123_number - - @property - def name(self): - """Gets the name of this Name. # noqa: E501 - - - :return: The name of this Name. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Name. - - - :param name: The name of this Name. # noqa: E501 - :type name: int - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def snake_case(self): - """Gets the snake_case of this Name. # noqa: E501 - - - :return: The snake_case of this Name. # noqa: E501 - :rtype: int - """ - return self._snake_case - - @snake_case.setter - def snake_case(self, snake_case): - """Sets the snake_case of this Name. - - - :param snake_case: The snake_case of this Name. # noqa: E501 - :type snake_case: int - """ - - self._snake_case = snake_case - - @property - def _property(self): - """Gets the _property of this Name. # noqa: E501 - - - :return: The _property of this Name. # noqa: E501 - :rtype: str - """ - return self.__property - - @_property.setter - def _property(self, _property): - """Sets the _property of this Name. - - - :param _property: The _property of this Name. # noqa: E501 - :type _property: str - """ - - self.__property = _property - - @property - def _123_number(self): - """Gets the _123_number of this Name. # noqa: E501 - - - :return: The _123_number of this Name. # noqa: E501 - :rtype: int - """ - return self.__123_number - - @_123_number.setter - def _123_number(self, _123_number): - """Sets the _123_number of this Name. - - - :param _123_number: The _123_number of this Name. # noqa: E501 - :type _123_number: int - """ - - self.__123_number = _123_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Name): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Name): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/number_only.py b/samples/client/petstore/python-legacy/petstore_api/models/number_only.py deleted file mode 100644 index 59a252e0bb66..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class NumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_number': 'float' - } - - attribute_map = { - 'just_number': 'JustNumber' - } - - def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_number = None - self.discriminator = None - - if just_number is not None: - self.just_number = just_number - - @property - def just_number(self): - """Gets the just_number of this NumberOnly. # noqa: E501 - - - :return: The just_number of this NumberOnly. # noqa: E501 - :rtype: float - """ - return self._just_number - - @just_number.setter - def just_number(self, just_number): - """Sets the just_number of this NumberOnly. - - - :param just_number: The just_number of this NumberOnly. # noqa: E501 - :type just_number: float - """ - - self._just_number = just_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, NumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/order.py b/samples/client/petstore/python-legacy/petstore_api/models/order.py deleted file mode 100644 index a267324d0d19..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/order.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Order(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool' - } - - attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } - - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 - """Order - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._pet_id = None - self._quantity = None - self._ship_date = None - self._status = None - self._complete = None - self.discriminator = None - - if id is not None: - self.id = id - if pet_id is not None: - self.pet_id = pet_id - if quantity is not None: - self.quantity = quantity - if ship_date is not None: - self.ship_date = ship_date - if status is not None: - self.status = status - if complete is not None: - self.complete = complete - - @property - def id(self): - """Gets the id of this Order. # noqa: E501 - - - :return: The id of this Order. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Order. - - - :param id: The id of this Order. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def pet_id(self): - """Gets the pet_id of this Order. # noqa: E501 - - - :return: The pet_id of this Order. # noqa: E501 - :rtype: int - """ - return self._pet_id - - @pet_id.setter - def pet_id(self, pet_id): - """Sets the pet_id of this Order. - - - :param pet_id: The pet_id of this Order. # noqa: E501 - :type pet_id: int - """ - - self._pet_id = pet_id - - @property - def quantity(self): - """Gets the quantity of this Order. # noqa: E501 - - - :return: The quantity of this Order. # noqa: E501 - :rtype: int - """ - return self._quantity - - @quantity.setter - def quantity(self, quantity): - """Sets the quantity of this Order. - - - :param quantity: The quantity of this Order. # noqa: E501 - :type quantity: int - """ - - self._quantity = quantity - - @property - def ship_date(self): - """Gets the ship_date of this Order. # noqa: E501 - - - :return: The ship_date of this Order. # noqa: E501 - :rtype: datetime - """ - return self._ship_date - - @ship_date.setter - def ship_date(self, ship_date): - """Sets the ship_date of this Order. - - - :param ship_date: The ship_date of this Order. # noqa: E501 - :type ship_date: datetime - """ - - self._ship_date = ship_date - - @property - def status(self): - """Gets the status of this Order. # noqa: E501 - - Order Status # noqa: E501 - - :return: The status of this Order. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Order. - - Order Status # noqa: E501 - - :param status: The status of this Order. # noqa: E501 - :type status: str - """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def complete(self): - """Gets the complete of this Order. # noqa: E501 - - - :return: The complete of this Order. # noqa: E501 - :rtype: bool - """ - return self._complete - - @complete.setter - def complete(self, complete): - """Sets the complete of this Order. - - - :param complete: The complete of this Order. # noqa: E501 - :type complete: bool - """ - - self._complete = complete - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Order): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Order): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py b/samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py deleted file mode 100644 index e26160ab4302..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/outer_composite.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterComposite(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'my_number': 'float', - 'my_string': 'str', - 'my_boolean': 'bool' - } - - attribute_map = { - 'my_number': 'my_number', - 'my_string': 'my_string', - 'my_boolean': 'my_boolean' - } - - def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._my_number = None - self._my_string = None - self._my_boolean = None - self.discriminator = None - - if my_number is not None: - self.my_number = my_number - if my_string is not None: - self.my_string = my_string - if my_boolean is not None: - self.my_boolean = my_boolean - - @property - def my_number(self): - """Gets the my_number of this OuterComposite. # noqa: E501 - - - :return: The my_number of this OuterComposite. # noqa: E501 - :rtype: float - """ - return self._my_number - - @my_number.setter - def my_number(self, my_number): - """Sets the my_number of this OuterComposite. - - - :param my_number: The my_number of this OuterComposite. # noqa: E501 - :type my_number: float - """ - - self._my_number = my_number - - @property - def my_string(self): - """Gets the my_string of this OuterComposite. # noqa: E501 - - - :return: The my_string of this OuterComposite. # noqa: E501 - :rtype: str - """ - return self._my_string - - @my_string.setter - def my_string(self, my_string): - """Sets the my_string of this OuterComposite. - - - :param my_string: The my_string of this OuterComposite. # noqa: E501 - :type my_string: str - """ - - self._my_string = my_string - - @property - def my_boolean(self): - """Gets the my_boolean of this OuterComposite. # noqa: E501 - - - :return: The my_boolean of this OuterComposite. # noqa: E501 - :rtype: bool - """ - return self._my_boolean - - @my_boolean.setter - def my_boolean(self, my_boolean): - """Sets the my_boolean of this OuterComposite. - - - :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 - :type my_boolean: bool - """ - - self._my_boolean = my_boolean - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterComposite): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterComposite): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py b/samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py deleted file mode 100644 index 27cdfd1fb791..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/outer_enum.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnum(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - - allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnum - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnum): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnum): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/pet.py b/samples/client/petstore/python-legacy/petstore_api/models/pet.py deleted file mode 100644 index 22bb4a585e47..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/pet.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Pet(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'category': 'Category', - 'name': 'str', - 'photo_urls': 'list[str]', - 'tags': 'list[Tag]', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } - - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 - """Pet - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._category = None - self._name = None - self._photo_urls = None - self._tags = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - if category is not None: - self.category = category - self.name = name - self.photo_urls = photo_urls - if tags is not None: - self.tags = tags - if status is not None: - self.status = status - - @property - def id(self): - """Gets the id of this Pet. # noqa: E501 - - - :return: The id of this Pet. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Pet. - - - :param id: The id of this Pet. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def category(self): - """Gets the category of this Pet. # noqa: E501 - - - :return: The category of this Pet. # noqa: E501 - :rtype: Category - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Pet. - - - :param category: The category of this Pet. # noqa: E501 - :type category: Category - """ - - self._category = category - - @property - def name(self): - """Gets the name of this Pet. # noqa: E501 - - - :return: The name of this Pet. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Pet. - - - :param name: The name of this Pet. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. # noqa: E501 - - - :return: The photo_urls of this Pet. # noqa: E501 - :rtype: list[str] - """ - return self._photo_urls - - @photo_urls.setter - def photo_urls(self, photo_urls): - """Sets the photo_urls of this Pet. - - - :param photo_urls: The photo_urls of this Pet. # noqa: E501 - :type photo_urls: list[str] - """ - if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 - raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 - - self._photo_urls = photo_urls - - @property - def tags(self): - """Gets the tags of this Pet. # noqa: E501 - - - :return: The tags of this Pet. # noqa: E501 - :rtype: list[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Pet. - - - :param tags: The tags of this Pet. # noqa: E501 - :type tags: list[Tag] - """ - - self._tags = tags - - @property - def status(self): - """Gets the status of this Pet. # noqa: E501 - - pet status in the store # noqa: E501 - - :return: The status of this Pet. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Pet. - - pet status in the store # noqa: E501 - - :param status: The status of this Pet. # noqa: E501 - :type status: str - """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Pet): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Pet): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py b/samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py deleted file mode 100644 index c2888eba7500..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/read_only_first.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ReadOnlyFirst(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'baz': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'baz': 'baz' - } - - def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._baz = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if baz is not None: - self.baz = baz - - @property - def bar(self): - """Gets the bar of this ReadOnlyFirst. # noqa: E501 - - - :return: The bar of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this ReadOnlyFirst. - - - :param bar: The bar of this ReadOnlyFirst. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def baz(self): - """Gets the baz of this ReadOnlyFirst. # noqa: E501 - - - :return: The baz of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._baz - - @baz.setter - def baz(self, baz): - """Sets the baz of this ReadOnlyFirst. - - - :param baz: The baz of this ReadOnlyFirst. # noqa: E501 - :type baz: str - """ - - self._baz = baz - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ReadOnlyFirst): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ReadOnlyFirst): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py b/samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py deleted file mode 100644 index 4c848e1887c0..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/special_model_name.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialModelName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'special_property_name': 'int' - } - - attribute_map = { - 'special_property_name': '$special[property.name]' - } - - def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._special_property_name = None - self.discriminator = None - - if special_property_name is not None: - self.special_property_name = special_property_name - - @property - def special_property_name(self): - """Gets the special_property_name of this SpecialModelName. # noqa: E501 - - - :return: The special_property_name of this SpecialModelName. # noqa: E501 - :rtype: int - """ - return self._special_property_name - - @special_property_name.setter - def special_property_name(self, special_property_name): - """Sets the special_property_name of this SpecialModelName. - - - :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 - :type special_property_name: int - """ - - self._special_property_name = special_property_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialModelName): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialModelName): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/tag.py b/samples/client/petstore/python-legacy/petstore_api/models/tag.py deleted file mode 100644 index a3e6789078d8..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/tag.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Tag(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 - """Tag - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - - :return: The id of this Tag. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - - :return: The name of this Tag. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - - :param name: The name of this Tag. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Tag): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py deleted file mode 100644 index 582b4c8d6dc2..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/type_holder_default.py +++ /dev/null @@ -1,240 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderDefault(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderDefault. # noqa: E501 - - - :return: The string_item of this TypeHolderDefault. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderDefault. - - - :param string_item: The string_item of this TypeHolderDefault. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderDefault. # noqa: E501 - - - :return: The number_item of this TypeHolderDefault. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderDefault. - - - :param number_item: The number_item of this TypeHolderDefault. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderDefault. # noqa: E501 - - - :return: The integer_item of this TypeHolderDefault. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderDefault. - - - :param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderDefault. # noqa: E501 - - - :return: The bool_item of this TypeHolderDefault. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderDefault. - - - :param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderDefault. # noqa: E501 - - - :return: The array_item of this TypeHolderDefault. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderDefault. - - - :param array_item: The array_item of this TypeHolderDefault. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderDefault): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderDefault): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py deleted file mode 100644 index 268595ed8681..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/type_holder_example.py +++ /dev/null @@ -1,267 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderExample(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'float_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'float_item': 'float_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._float_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.float_item = float_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderExample. # noqa: E501 - - - :return: The string_item of this TypeHolderExample. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderExample. - - - :param string_item: The string_item of this TypeHolderExample. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderExample. # noqa: E501 - - - :return: The number_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderExample. - - - :param number_item: The number_item of this TypeHolderExample. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def float_item(self): - """Gets the float_item of this TypeHolderExample. # noqa: E501 - - - :return: The float_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._float_item - - @float_item.setter - def float_item(self, float_item): - """Sets the float_item of this TypeHolderExample. - - - :param float_item: The float_item of this TypeHolderExample. # noqa: E501 - :type float_item: float - """ - if self.local_vars_configuration.client_side_validation and float_item is None: # noqa: E501 - raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 - - self._float_item = float_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderExample. # noqa: E501 - - - :return: The integer_item of this TypeHolderExample. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderExample. - - - :param integer_item: The integer_item of this TypeHolderExample. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderExample. # noqa: E501 - - - :return: The bool_item of this TypeHolderExample. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderExample. - - - :param bool_item: The bool_item of this TypeHolderExample. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderExample. # noqa: E501 - - - :return: The array_item of this TypeHolderExample. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderExample. - - - :param array_item: The array_item of this TypeHolderExample. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderExample): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderExample): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/user.py b/samples/client/petstore/python-legacy/petstore_api/models/user.py deleted file mode 100644 index 7ae2898f6c5a..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/user.py +++ /dev/null @@ -1,315 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class User(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int' - } - - attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } - - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 - """User - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._username = None - self._first_name = None - self._last_name = None - self._email = None - self._password = None - self._phone = None - self._user_status = None - self.discriminator = None - - if id is not None: - self.id = id - if username is not None: - self.username = username - if first_name is not None: - self.first_name = first_name - if last_name is not None: - self.last_name = last_name - if email is not None: - self.email = email - if password is not None: - self.password = password - if phone is not None: - self.phone = phone - if user_status is not None: - self.user_status = user_status - - @property - def id(self): - """Gets the id of this User. # noqa: E501 - - - :return: The id of this User. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this User. - - - :param id: The id of this User. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def username(self): - """Gets the username of this User. # noqa: E501 - - - :return: The username of this User. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this User. - - - :param username: The username of this User. # noqa: E501 - :type username: str - """ - - self._username = username - - @property - def first_name(self): - """Gets the first_name of this User. # noqa: E501 - - - :return: The first_name of this User. # noqa: E501 - :rtype: str - """ - return self._first_name - - @first_name.setter - def first_name(self, first_name): - """Sets the first_name of this User. - - - :param first_name: The first_name of this User. # noqa: E501 - :type first_name: str - """ - - self._first_name = first_name - - @property - def last_name(self): - """Gets the last_name of this User. # noqa: E501 - - - :return: The last_name of this User. # noqa: E501 - :rtype: str - """ - return self._last_name - - @last_name.setter - def last_name(self, last_name): - """Sets the last_name of this User. - - - :param last_name: The last_name of this User. # noqa: E501 - :type last_name: str - """ - - self._last_name = last_name - - @property - def email(self): - """Gets the email of this User. # noqa: E501 - - - :return: The email of this User. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this User. - - - :param email: The email of this User. # noqa: E501 - :type email: str - """ - - self._email = email - - @property - def password(self): - """Gets the password of this User. # noqa: E501 - - - :return: The password of this User. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this User. - - - :param password: The password of this User. # noqa: E501 - :type password: str - """ - - self._password = password - - @property - def phone(self): - """Gets the phone of this User. # noqa: E501 - - - :return: The phone of this User. # noqa: E501 - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this User. - - - :param phone: The phone of this User. # noqa: E501 - :type phone: str - """ - - self._phone = phone - - @property - def user_status(self): - """Gets the user_status of this User. # noqa: E501 - - User Status # noqa: E501 - - :return: The user_status of this User. # noqa: E501 - :rtype: int - """ - return self._user_status - - @user_status.setter - def user_status(self, user_status): - """Sets the user_status of this User. - - User Status # noqa: E501 - - :param user_status: The user_status of this User. # noqa: E501 - :type user_status: int - """ - - self._user_status = user_status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, User): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, User): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/models/xml_item.py b/samples/client/petstore/python-legacy/petstore_api/models/xml_item.py deleted file mode 100644 index 5e6fecdd71c8..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/models/xml_item.py +++ /dev/null @@ -1,859 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class XmlItem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'attribute_string': 'str', - 'attribute_number': 'float', - 'attribute_integer': 'int', - 'attribute_boolean': 'bool', - 'wrapped_array': 'list[int]', - 'name_string': 'str', - 'name_number': 'float', - 'name_integer': 'int', - 'name_boolean': 'bool', - 'name_array': 'list[int]', - 'name_wrapped_array': 'list[int]', - 'prefix_string': 'str', - 'prefix_number': 'float', - 'prefix_integer': 'int', - 'prefix_boolean': 'bool', - 'prefix_array': 'list[int]', - 'prefix_wrapped_array': 'list[int]', - 'namespace_string': 'str', - 'namespace_number': 'float', - 'namespace_integer': 'int', - 'namespace_boolean': 'bool', - 'namespace_array': 'list[int]', - 'namespace_wrapped_array': 'list[int]', - 'prefix_ns_string': 'str', - 'prefix_ns_number': 'float', - 'prefix_ns_integer': 'int', - 'prefix_ns_boolean': 'bool', - 'prefix_ns_array': 'list[int]', - 'prefix_ns_wrapped_array': 'list[int]' - } - - attribute_map = { - 'attribute_string': 'attribute_string', - 'attribute_number': 'attribute_number', - 'attribute_integer': 'attribute_integer', - 'attribute_boolean': 'attribute_boolean', - 'wrapped_array': 'wrapped_array', - 'name_string': 'name_string', - 'name_number': 'name_number', - 'name_integer': 'name_integer', - 'name_boolean': 'name_boolean', - 'name_array': 'name_array', - 'name_wrapped_array': 'name_wrapped_array', - 'prefix_string': 'prefix_string', - 'prefix_number': 'prefix_number', - 'prefix_integer': 'prefix_integer', - 'prefix_boolean': 'prefix_boolean', - 'prefix_array': 'prefix_array', - 'prefix_wrapped_array': 'prefix_wrapped_array', - 'namespace_string': 'namespace_string', - 'namespace_number': 'namespace_number', - 'namespace_integer': 'namespace_integer', - 'namespace_boolean': 'namespace_boolean', - 'namespace_array': 'namespace_array', - 'namespace_wrapped_array': 'namespace_wrapped_array', - 'prefix_ns_string': 'prefix_ns_string', - 'prefix_ns_number': 'prefix_ns_number', - 'prefix_ns_integer': 'prefix_ns_integer', - 'prefix_ns_boolean': 'prefix_ns_boolean', - 'prefix_ns_array': 'prefix_ns_array', - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' - } - - def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None, local_vars_configuration=None): # noqa: E501 - """XmlItem - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._attribute_string = None - self._attribute_number = None - self._attribute_integer = None - self._attribute_boolean = None - self._wrapped_array = None - self._name_string = None - self._name_number = None - self._name_integer = None - self._name_boolean = None - self._name_array = None - self._name_wrapped_array = None - self._prefix_string = None - self._prefix_number = None - self._prefix_integer = None - self._prefix_boolean = None - self._prefix_array = None - self._prefix_wrapped_array = None - self._namespace_string = None - self._namespace_number = None - self._namespace_integer = None - self._namespace_boolean = None - self._namespace_array = None - self._namespace_wrapped_array = None - self._prefix_ns_string = None - self._prefix_ns_number = None - self._prefix_ns_integer = None - self._prefix_ns_boolean = None - self._prefix_ns_array = None - self._prefix_ns_wrapped_array = None - self.discriminator = None - - if attribute_string is not None: - self.attribute_string = attribute_string - if attribute_number is not None: - self.attribute_number = attribute_number - if attribute_integer is not None: - self.attribute_integer = attribute_integer - if attribute_boolean is not None: - self.attribute_boolean = attribute_boolean - if wrapped_array is not None: - self.wrapped_array = wrapped_array - if name_string is not None: - self.name_string = name_string - if name_number is not None: - self.name_number = name_number - if name_integer is not None: - self.name_integer = name_integer - if name_boolean is not None: - self.name_boolean = name_boolean - if name_array is not None: - self.name_array = name_array - if name_wrapped_array is not None: - self.name_wrapped_array = name_wrapped_array - if prefix_string is not None: - self.prefix_string = prefix_string - if prefix_number is not None: - self.prefix_number = prefix_number - if prefix_integer is not None: - self.prefix_integer = prefix_integer - if prefix_boolean is not None: - self.prefix_boolean = prefix_boolean - if prefix_array is not None: - self.prefix_array = prefix_array - if prefix_wrapped_array is not None: - self.prefix_wrapped_array = prefix_wrapped_array - if namespace_string is not None: - self.namespace_string = namespace_string - if namespace_number is not None: - self.namespace_number = namespace_number - if namespace_integer is not None: - self.namespace_integer = namespace_integer - if namespace_boolean is not None: - self.namespace_boolean = namespace_boolean - if namespace_array is not None: - self.namespace_array = namespace_array - if namespace_wrapped_array is not None: - self.namespace_wrapped_array = namespace_wrapped_array - if prefix_ns_string is not None: - self.prefix_ns_string = prefix_ns_string - if prefix_ns_number is not None: - self.prefix_ns_number = prefix_ns_number - if prefix_ns_integer is not None: - self.prefix_ns_integer = prefix_ns_integer - if prefix_ns_boolean is not None: - self.prefix_ns_boolean = prefix_ns_boolean - if prefix_ns_array is not None: - self.prefix_ns_array = prefix_ns_array - if prefix_ns_wrapped_array is not None: - self.prefix_ns_wrapped_array = prefix_ns_wrapped_array - - @property - def attribute_string(self): - """Gets the attribute_string of this XmlItem. # noqa: E501 - - - :return: The attribute_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._attribute_string - - @attribute_string.setter - def attribute_string(self, attribute_string): - """Sets the attribute_string of this XmlItem. - - - :param attribute_string: The attribute_string of this XmlItem. # noqa: E501 - :type attribute_string: str - """ - - self._attribute_string = attribute_string - - @property - def attribute_number(self): - """Gets the attribute_number of this XmlItem. # noqa: E501 - - - :return: The attribute_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._attribute_number - - @attribute_number.setter - def attribute_number(self, attribute_number): - """Sets the attribute_number of this XmlItem. - - - :param attribute_number: The attribute_number of this XmlItem. # noqa: E501 - :type attribute_number: float - """ - - self._attribute_number = attribute_number - - @property - def attribute_integer(self): - """Gets the attribute_integer of this XmlItem. # noqa: E501 - - - :return: The attribute_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._attribute_integer - - @attribute_integer.setter - def attribute_integer(self, attribute_integer): - """Sets the attribute_integer of this XmlItem. - - - :param attribute_integer: The attribute_integer of this XmlItem. # noqa: E501 - :type attribute_integer: int - """ - - self._attribute_integer = attribute_integer - - @property - def attribute_boolean(self): - """Gets the attribute_boolean of this XmlItem. # noqa: E501 - - - :return: The attribute_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._attribute_boolean - - @attribute_boolean.setter - def attribute_boolean(self, attribute_boolean): - """Sets the attribute_boolean of this XmlItem. - - - :param attribute_boolean: The attribute_boolean of this XmlItem. # noqa: E501 - :type attribute_boolean: bool - """ - - self._attribute_boolean = attribute_boolean - - @property - def wrapped_array(self): - """Gets the wrapped_array of this XmlItem. # noqa: E501 - - - :return: The wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._wrapped_array - - @wrapped_array.setter - def wrapped_array(self, wrapped_array): - """Sets the wrapped_array of this XmlItem. - - - :param wrapped_array: The wrapped_array of this XmlItem. # noqa: E501 - :type wrapped_array: list[int] - """ - - self._wrapped_array = wrapped_array - - @property - def name_string(self): - """Gets the name_string of this XmlItem. # noqa: E501 - - - :return: The name_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._name_string - - @name_string.setter - def name_string(self, name_string): - """Sets the name_string of this XmlItem. - - - :param name_string: The name_string of this XmlItem. # noqa: E501 - :type name_string: str - """ - - self._name_string = name_string - - @property - def name_number(self): - """Gets the name_number of this XmlItem. # noqa: E501 - - - :return: The name_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._name_number - - @name_number.setter - def name_number(self, name_number): - """Sets the name_number of this XmlItem. - - - :param name_number: The name_number of this XmlItem. # noqa: E501 - :type name_number: float - """ - - self._name_number = name_number - - @property - def name_integer(self): - """Gets the name_integer of this XmlItem. # noqa: E501 - - - :return: The name_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._name_integer - - @name_integer.setter - def name_integer(self, name_integer): - """Sets the name_integer of this XmlItem. - - - :param name_integer: The name_integer of this XmlItem. # noqa: E501 - :type name_integer: int - """ - - self._name_integer = name_integer - - @property - def name_boolean(self): - """Gets the name_boolean of this XmlItem. # noqa: E501 - - - :return: The name_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._name_boolean - - @name_boolean.setter - def name_boolean(self, name_boolean): - """Sets the name_boolean of this XmlItem. - - - :param name_boolean: The name_boolean of this XmlItem. # noqa: E501 - :type name_boolean: bool - """ - - self._name_boolean = name_boolean - - @property - def name_array(self): - """Gets the name_array of this XmlItem. # noqa: E501 - - - :return: The name_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_array - - @name_array.setter - def name_array(self, name_array): - """Sets the name_array of this XmlItem. - - - :param name_array: The name_array of this XmlItem. # noqa: E501 - :type name_array: list[int] - """ - - self._name_array = name_array - - @property - def name_wrapped_array(self): - """Gets the name_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The name_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_wrapped_array - - @name_wrapped_array.setter - def name_wrapped_array(self, name_wrapped_array): - """Sets the name_wrapped_array of this XmlItem. - - - :param name_wrapped_array: The name_wrapped_array of this XmlItem. # noqa: E501 - :type name_wrapped_array: list[int] - """ - - self._name_wrapped_array = name_wrapped_array - - @property - def prefix_string(self): - """Gets the prefix_string of this XmlItem. # noqa: E501 - - - :return: The prefix_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_string - - @prefix_string.setter - def prefix_string(self, prefix_string): - """Sets the prefix_string of this XmlItem. - - - :param prefix_string: The prefix_string of this XmlItem. # noqa: E501 - :type prefix_string: str - """ - - self._prefix_string = prefix_string - - @property - def prefix_number(self): - """Gets the prefix_number of this XmlItem. # noqa: E501 - - - :return: The prefix_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_number - - @prefix_number.setter - def prefix_number(self, prefix_number): - """Sets the prefix_number of this XmlItem. - - - :param prefix_number: The prefix_number of this XmlItem. # noqa: E501 - :type prefix_number: float - """ - - self._prefix_number = prefix_number - - @property - def prefix_integer(self): - """Gets the prefix_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_integer - - @prefix_integer.setter - def prefix_integer(self, prefix_integer): - """Sets the prefix_integer of this XmlItem. - - - :param prefix_integer: The prefix_integer of this XmlItem. # noqa: E501 - :type prefix_integer: int - """ - - self._prefix_integer = prefix_integer - - @property - def prefix_boolean(self): - """Gets the prefix_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_boolean - - @prefix_boolean.setter - def prefix_boolean(self, prefix_boolean): - """Sets the prefix_boolean of this XmlItem. - - - :param prefix_boolean: The prefix_boolean of this XmlItem. # noqa: E501 - :type prefix_boolean: bool - """ - - self._prefix_boolean = prefix_boolean - - @property - def prefix_array(self): - """Gets the prefix_array of this XmlItem. # noqa: E501 - - - :return: The prefix_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_array - - @prefix_array.setter - def prefix_array(self, prefix_array): - """Sets the prefix_array of this XmlItem. - - - :param prefix_array: The prefix_array of this XmlItem. # noqa: E501 - :type prefix_array: list[int] - """ - - self._prefix_array = prefix_array - - @property - def prefix_wrapped_array(self): - """Gets the prefix_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_wrapped_array - - @prefix_wrapped_array.setter - def prefix_wrapped_array(self, prefix_wrapped_array): - """Sets the prefix_wrapped_array of this XmlItem. - - - :param prefix_wrapped_array: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_wrapped_array: list[int] - """ - - self._prefix_wrapped_array = prefix_wrapped_array - - @property - def namespace_string(self): - """Gets the namespace_string of this XmlItem. # noqa: E501 - - - :return: The namespace_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._namespace_string - - @namespace_string.setter - def namespace_string(self, namespace_string): - """Sets the namespace_string of this XmlItem. - - - :param namespace_string: The namespace_string of this XmlItem. # noqa: E501 - :type namespace_string: str - """ - - self._namespace_string = namespace_string - - @property - def namespace_number(self): - """Gets the namespace_number of this XmlItem. # noqa: E501 - - - :return: The namespace_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._namespace_number - - @namespace_number.setter - def namespace_number(self, namespace_number): - """Sets the namespace_number of this XmlItem. - - - :param namespace_number: The namespace_number of this XmlItem. # noqa: E501 - :type namespace_number: float - """ - - self._namespace_number = namespace_number - - @property - def namespace_integer(self): - """Gets the namespace_integer of this XmlItem. # noqa: E501 - - - :return: The namespace_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._namespace_integer - - @namespace_integer.setter - def namespace_integer(self, namespace_integer): - """Sets the namespace_integer of this XmlItem. - - - :param namespace_integer: The namespace_integer of this XmlItem. # noqa: E501 - :type namespace_integer: int - """ - - self._namespace_integer = namespace_integer - - @property - def namespace_boolean(self): - """Gets the namespace_boolean of this XmlItem. # noqa: E501 - - - :return: The namespace_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._namespace_boolean - - @namespace_boolean.setter - def namespace_boolean(self, namespace_boolean): - """Sets the namespace_boolean of this XmlItem. - - - :param namespace_boolean: The namespace_boolean of this XmlItem. # noqa: E501 - :type namespace_boolean: bool - """ - - self._namespace_boolean = namespace_boolean - - @property - def namespace_array(self): - """Gets the namespace_array of this XmlItem. # noqa: E501 - - - :return: The namespace_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_array - - @namespace_array.setter - def namespace_array(self, namespace_array): - """Sets the namespace_array of this XmlItem. - - - :param namespace_array: The namespace_array of this XmlItem. # noqa: E501 - :type namespace_array: list[int] - """ - - self._namespace_array = namespace_array - - @property - def namespace_wrapped_array(self): - """Gets the namespace_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_wrapped_array - - @namespace_wrapped_array.setter - def namespace_wrapped_array(self, namespace_wrapped_array): - """Sets the namespace_wrapped_array of this XmlItem. - - - :param namespace_wrapped_array: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :type namespace_wrapped_array: list[int] - """ - - self._namespace_wrapped_array = namespace_wrapped_array - - @property - def prefix_ns_string(self): - """Gets the prefix_ns_string of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_ns_string - - @prefix_ns_string.setter - def prefix_ns_string(self, prefix_ns_string): - """Sets the prefix_ns_string of this XmlItem. - - - :param prefix_ns_string: The prefix_ns_string of this XmlItem. # noqa: E501 - :type prefix_ns_string: str - """ - - self._prefix_ns_string = prefix_ns_string - - @property - def prefix_ns_number(self): - """Gets the prefix_ns_number of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_ns_number - - @prefix_ns_number.setter - def prefix_ns_number(self, prefix_ns_number): - """Sets the prefix_ns_number of this XmlItem. - - - :param prefix_ns_number: The prefix_ns_number of this XmlItem. # noqa: E501 - :type prefix_ns_number: float - """ - - self._prefix_ns_number = prefix_ns_number - - @property - def prefix_ns_integer(self): - """Gets the prefix_ns_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_ns_integer - - @prefix_ns_integer.setter - def prefix_ns_integer(self, prefix_ns_integer): - """Sets the prefix_ns_integer of this XmlItem. - - - :param prefix_ns_integer: The prefix_ns_integer of this XmlItem. # noqa: E501 - :type prefix_ns_integer: int - """ - - self._prefix_ns_integer = prefix_ns_integer - - @property - def prefix_ns_boolean(self): - """Gets the prefix_ns_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_ns_boolean - - @prefix_ns_boolean.setter - def prefix_ns_boolean(self, prefix_ns_boolean): - """Sets the prefix_ns_boolean of this XmlItem. - - - :param prefix_ns_boolean: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :type prefix_ns_boolean: bool - """ - - self._prefix_ns_boolean = prefix_ns_boolean - - @property - def prefix_ns_array(self): - """Gets the prefix_ns_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_array - - @prefix_ns_array.setter - def prefix_ns_array(self, prefix_ns_array): - """Sets the prefix_ns_array of this XmlItem. - - - :param prefix_ns_array: The prefix_ns_array of this XmlItem. # noqa: E501 - :type prefix_ns_array: list[int] - """ - - self._prefix_ns_array = prefix_ns_array - - @property - def prefix_ns_wrapped_array(self): - """Gets the prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_wrapped_array - - @prefix_ns_wrapped_array.setter - def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): - """Sets the prefix_ns_wrapped_array of this XmlItem. - - - :param prefix_ns_wrapped_array: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_ns_wrapped_array: list[int] - """ - - self._prefix_ns_wrapped_array = prefix_ns_wrapped_array - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, XmlItem): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, XmlItem): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-legacy/petstore_api/rest.py b/samples/client/petstore/python-legacy/petstore_api/rest.py deleted file mode 100644 index a9aa12156fc2..000000000000 --- a/samples/client/petstore/python-legacy/petstore_api/rest.py +++ /dev/null @@ -1,301 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import io -import json -import logging -import re -import ssl - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode -import urllib3 - -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) diff --git a/samples/client/petstore/python-legacy/pom.xml b/samples/client/petstore/python-legacy/pom.xml deleted file mode 100644 index 71814d4388d9..000000000000 --- a/samples/client/petstore/python-legacy/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonPetstoreClientTests - pom - 1.0-SNAPSHOT - Python OpenAPI Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test-all - - - - - - - - diff --git a/samples/client/petstore/python-legacy/requirements.txt b/samples/client/petstore/python-legacy/requirements.txt deleted file mode 100644 index d0518ec800e9..000000000000 --- a/samples/client/petstore/python-legacy/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python-legacy/setup.cfg b/samples/client/petstore/python-legacy/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/client/petstore/python-legacy/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/client/petstore/python-legacy/setup.py b/samples/client/petstore/python-legacy/setup.py deleted file mode 100644 index 58abfa11b8df..000000000000 --- a/samples/client/petstore/python-legacy/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description_content_type='text/markdown', - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/client/petstore/python-legacy/test-requirements.txt b/samples/client/petstore/python-legacy/test-requirements.txt deleted file mode 100644 index 96e37c87e984..000000000000 --- a/samples/client/petstore/python-legacy/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<'3.0' diff --git a/samples/client/petstore/python-legacy/test/__init__.py b/samples/client/petstore/python-legacy/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py b/samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py deleted file mode 100644 index 4b6739a1faf3..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_any_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesAnyType(unittest.TestCase): - """AdditionalPropertiesAnyType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesAnyType(self): - """Test AdditionalPropertiesAnyType""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_array.py b/samples/client/petstore/python-legacy/test/test_additional_properties_array.py deleted file mode 100644 index c4cf43499cfa..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_array.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesArray(unittest.TestCase): - """AdditionalPropertiesArray unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesArray(self): - """Test AdditionalPropertiesArray""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_array.AdditionalPropertiesArray() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py b/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py deleted file mode 100644 index cc3cecc8522f..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_boolean.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesBoolean(unittest.TestCase): - """AdditionalPropertiesBoolean unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesBoolean(self): - """Test AdditionalPropertiesBoolean""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_boolean.AdditionalPropertiesBoolean() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_class.py b/samples/client/petstore/python-legacy/test/test_additional_properties_class.py deleted file mode 100644 index fc9df3bbb505..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py b/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py deleted file mode 100644 index 774c367b2109..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_integer.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesInteger(unittest.TestCase): - """AdditionalPropertiesInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesInteger(self): - """Test AdditionalPropertiesInteger""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_integer.AdditionalPropertiesInteger() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_number.py b/samples/client/petstore/python-legacy/test/test_additional_properties_number.py deleted file mode 100644 index 0d370e781b36..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_number.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesNumber(unittest.TestCase): - """AdditionalPropertiesNumber unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesNumber(self): - """Test AdditionalPropertiesNumber""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_number.AdditionalPropertiesNumber() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_object.py b/samples/client/petstore/python-legacy/test/test_additional_properties_object.py deleted file mode 100644 index 6e718b28cdef..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesObject(unittest.TestCase): - """AdditionalPropertiesObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesObject(self): - """Test AdditionalPropertiesObject""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_additional_properties_string.py b/samples/client/petstore/python-legacy/test/test_additional_properties_string.py deleted file mode 100644 index a46cb3e256dc..000000000000 --- a/samples/client/petstore/python-legacy/test/test_additional_properties_string.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesString(unittest.TestCase): - """AdditionalPropertiesString unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesString(self): - """Test AdditionalPropertiesString""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_string.AdditionalPropertiesString() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_animal.py b/samples/client/petstore/python-legacy/test/test_animal.py deleted file mode 100644 index 88d0693a1003..000000000000 --- a/samples/client/petstore/python-legacy/test/test_animal.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Animal - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.animal.Animal() # noqa: E501 - if include_optional : - return Animal( - class_name = '0', - color = 'red' - ) - else : - return Animal( - class_name = '0', - ) - - def testAnimal(self): - """Test Animal""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_another_fake_api.py b/samples/client/petstore/python-legacy/test/test_another_fake_api.py deleted file mode 100644 index 4b80dc4eda52..000000000000 --- a/samples/client/petstore/python-legacy/test/test_another_fake_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_test_special_tags(self): - """Test case for test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_api_response.py b/samples/client/petstore/python-legacy/test/test_api_response.py deleted file mode 100644 index 5031b458a0db..000000000000 --- a/samples/client/petstore/python-legacy/test/test_api_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py deleted file mode 100644 index a02233045421..000000000000 --- a/samples/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_array_of_number_only.py b/samples/client/petstore/python-legacy/test/test_array_of_number_only.py deleted file mode 100644 index 1a928bf7d2e0..000000000000 --- a/samples/client/petstore/python-legacy/test/test_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_array_test.py b/samples/client/petstore/python-legacy/test/test_array_test.py deleted file mode 100644 index c56b77b77ee3..000000000000 --- a/samples/client/petstore/python-legacy/test/test_array_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_big_cat.py b/samples/client/petstore/python-legacy/test/test_big_cat.py deleted file mode 100644 index be428433ad4f..000000000000 --- a/samples/client/petstore/python-legacy/test/test_big_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat import BigCat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCat(unittest.TestCase): - """BigCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCat(self): - """Test BigCat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat.BigCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_big_cat_all_of.py b/samples/client/petstore/python-legacy/test/test_big_cat_all_of.py deleted file mode 100644 index c0e71dbfcde6..000000000000 --- a/samples/client/petstore/python-legacy/test/test_big_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat_all_of import BigCatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCatAllOf(unittest.TestCase): - """BigCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCatAllOf(self): - """Test BigCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat_all_of.BigCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_capitalization.py b/samples/client/petstore/python-legacy/test/test_capitalization.py deleted file mode 100644 index 2ae7725b3f09..000000000000 --- a/samples/client/petstore/python-legacy/test/test_capitalization.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_cat.py b/samples/client/petstore/python-legacy/test/test_cat.py deleted file mode 100644 index a835b6af736b..000000000000 --- a/samples/client/petstore/python-legacy/test/test_cat.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Cat - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.cat.Cat() # noqa: E501 - if include_optional : - return Cat( - declawed = True - ) - else : - return Cat( - ) - - def testCat(self): - """Test Cat""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_cat_all_of.py b/samples/client/petstore/python-legacy/test/test_cat_all_of.py deleted file mode 100644 index 531443380c6e..000000000000 --- a/samples/client/petstore/python-legacy/test/test_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_category.py b/samples/client/petstore/python-legacy/test/test_category.py deleted file mode 100644 index 05b4714fe9f3..000000000000 --- a/samples/client/petstore/python-legacy/test/test_category.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Category - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.category.Category() # noqa: E501 - if include_optional : - return Category( - id = 56, - name = 'default-name' - ) - else : - return Category( - name = 'default-name', - ) - - def testCategory(self): - """Test Category""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_class_model.py b/samples/client/petstore/python-legacy/test/test_class_model.py deleted file mode 100644 index 12b7fb99402e..000000000000 --- a/samples/client/petstore/python-legacy/test/test_class_model.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_client.py b/samples/client/petstore/python-legacy/test/test_client.py deleted file mode 100644 index 9e18c4310d96..000000000000 --- a/samples/client/petstore/python-legacy/test/test_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.client.Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_dog.py b/samples/client/petstore/python-legacy/test/test_dog.py deleted file mode 100644 index dc151f998ddd..000000000000 --- a/samples/client/petstore/python-legacy/test/test_dog.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog import Dog # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog.Dog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_dog_all_of.py b/samples/client/petstore/python-legacy/test/test_dog_all_of.py deleted file mode 100644 index 3d79f2888c96..000000000000 --- a/samples/client/petstore/python-legacy/test/test_dog_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_enum_arrays.py b/samples/client/petstore/python-legacy/test/test_enum_arrays.py deleted file mode 100644 index be572508ef22..000000000000 --- a/samples/client/petstore/python-legacy/test/test_enum_arrays.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_enum_class.py b/samples/client/petstore/python-legacy/test/test_enum_class.py deleted file mode 100644 index f092ab776424..000000000000 --- a/samples/client/petstore/python-legacy/test/test_enum_class.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test EnumClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - if include_optional : - return EnumClass( - ) - else : - return EnumClass( - ) - - def testEnumClass(self): - """Test EnumClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_enum_test.py b/samples/client/petstore/python-legacy/test/test_enum_test.py deleted file mode 100644 index ecd43afc709d..000000000000 --- a/samples/client/petstore/python-legacy/test/test_enum_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_fake_api.py b/samples/client/petstore/python-legacy/test/test_fake_api.py deleted file mode 100644 index fc2cbef35f1c..000000000000 --- a/samples/client/petstore/python-legacy/test/test_fake_api.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize - - """ - pass - - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize - - """ - pass - - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize - - """ - pass - - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index 87cac0b9ef85..000000000000 --- a/samples/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_file.py b/samples/client/petstore/python-legacy/test/test_file.py deleted file mode 100644 index bc51bffba560..000000000000 --- a/samples/client/petstore/python-legacy/test/test_file.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test File - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.file.File() # noqa: E501 - if include_optional : - return File( - source_uri = '0' - ) - else : - return File( - ) - - def testFile(self): - """Test File""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py b/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py deleted file mode 100644 index 182a1b0a5537..000000000000 --- a/samples/client/petstore/python-legacy/test/test_file_schema_test_class.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FileSchemaTestClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - if include_optional : - return FileSchemaTestClass( - file = petstore_api.models.file.File( - source_uri = '0', ), - files = [ - petstore_api.models.file.File( - source_uri = '0', ) - ] - ) - else : - return FileSchemaTestClass( - ) - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_format_test.py b/samples/client/petstore/python-legacy/test/test_format_test.py deleted file mode 100644 index e64c47b385d7..000000000000 --- a/samples/client/petstore/python-legacy/test/test_format_test.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FormatTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - if include_optional : - return FormatTest( - integer = 1E+1, - int32 = 2E+1, - int64 = 56, - number = 32.1, - float = 54.3, - double = 67.8, - string = 'a', - byte = 'YQ==', - binary = 'bytes', - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84', - password = '0123456789', - big_decimal = 1 - ) - else : - return FormatTest( - number = 32.1, - byte = 'YQ==', - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - password = '0123456789', - ) - - def testFormatTest(self): - """Test FormatTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_has_only_read_only.py b/samples/client/petstore/python-legacy/test/test_has_only_read_only.py deleted file mode 100644 index 2dc052a328a0..000000000000 --- a/samples/client/petstore/python-legacy/test/test_has_only_read_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_list.py b/samples/client/petstore/python-legacy/test/test_list.py deleted file mode 100644 index a538a6b1ad36..000000000000 --- a/samples/client/petstore/python-legacy/test/test_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.list.List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_map_test.py b/samples/client/petstore/python-legacy/test/test_map_test.py deleted file mode 100644 index 40eb0a42e6ea..000000000000 --- a/samples/client/petstore/python-legacy/test/test_map_test.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MapTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - if include_optional : - return MapTest( - map_map_of_string = { - 'key' : { - 'key' : '0' - } - }, - map_of_enum_string = { - 'UPPER' : 'UPPER' - }, - direct_map = { - 'key' : True - }, - indirect_map = { - 'key' : True - } - ) - else : - return MapTest( - ) - - def testMapTest(self): - """Test MapTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index ef77830aa192..000000000000 --- a/samples/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MixedPropertiesAndAdditionalPropertiesClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - if include_optional : - return MixedPropertiesAndAdditionalPropertiesClass( - uuid = '0', - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - map = { - 'key' : petstore_api.models.animal.Animal( - class_name = '0', - color = 'red', ) - } - ) - else : - return MixedPropertiesAndAdditionalPropertiesClass( - ) - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_model200_response.py b/samples/client/petstore/python-legacy/test/test_model200_response.py deleted file mode 100644 index fab761f4edba..000000000000 --- a/samples/client/petstore/python-legacy/test/test_model200_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_model_200_response.py b/samples/client/petstore/python-legacy/test/test_model_200_response.py deleted file mode 100644 index 314ee5e3dde6..000000000000 --- a/samples/client/petstore/python-legacy/test/test_model_200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model_200_response import Model_200Response # noqa: E501 -from petstore_api.rest import ApiException - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Model_200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model_200_response.Model_200Response() # noqa: E501 - if include_optional : - return Model_200Response( - name = 56, - _class = '' - ) - else : - return Model_200Response( - ) - - def testModel_200Response(self): - """Test Model_200Response""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_model_return.py b/samples/client/petstore/python-legacy/test/test_model_return.py deleted file mode 100644 index ae3f15ee6b83..000000000000 --- a/samples/client/petstore/python-legacy/test/test_model_return.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_name.py b/samples/client/petstore/python-legacy/test/test_name.py deleted file mode 100644 index d6c72563991f..000000000000 --- a/samples/client/petstore/python-legacy/test/test_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.name.Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_number_only.py b/samples/client/petstore/python-legacy/test/test_number_only.py deleted file mode 100644 index 7f6df65c8058..000000000000 --- a/samples/client/petstore/python-legacy/test/test_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_order.py b/samples/client/petstore/python-legacy/test/test_order.py deleted file mode 100644 index 3e7d517d5c79..000000000000 --- a/samples/client/petstore/python-legacy/test/test_order.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.order.Order() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_outer_composite.py b/samples/client/petstore/python-legacy/test/test_outer_composite.py deleted file mode 100644 index dcb078cd2164..000000000000 --- a/samples/client/petstore/python-legacy/test/test_outer_composite.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_outer_enum.py b/samples/client/petstore/python-legacy/test/test_outer_enum.py deleted file mode 100644 index 472e36e16821..000000000000 --- a/samples/client/petstore/python-legacy/test/test_outer_enum.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnum(self): - """Test OuterEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_pet.py b/samples/client/petstore/python-legacy/test/test_pet.py deleted file mode 100644 index 2e4a40d78b31..000000000000 --- a/samples/client/petstore/python-legacy/test/test_pet.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Pet - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.pet.Pet() # noqa: E501 - if include_optional : - return Pet( - id = 56, - category = petstore_api.models.category.Category( - id = 56, - name = 'default-name', ), - name = 'doggie', - photo_urls = [ - '0' - ], - tags = [ - petstore_api.models.tag.Tag( - id = 56, - name = '0', ) - ], - status = 'available' - ) - else : - return Pet( - name = 'doggie', - photo_urls = [ - '0' - ], - ) - - def testPet(self): - """Test Pet""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_pet_api.py b/samples/client/petstore/python-legacy/test/test_pet_api.py deleted file mode 100644 index ffd3e25c4c64..000000000000 --- a/samples/client/petstore/python-legacy/test/test_pet_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_read_only_first.py b/samples/client/petstore/python-legacy/test/test_read_only_first.py deleted file mode 100644 index 2b647b83fc89..000000000000 --- a/samples/client/petstore/python-legacy/test/test_read_only_first.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_special_model_name.py b/samples/client/petstore/python-legacy/test/test_special_model_name.py deleted file mode 100644 index 4edfec164f7d..000000000000 --- a/samples/client/petstore/python-legacy/test/test_special_model_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_store_api.py b/samples/client/petstore/python-legacy/test/test_store_api.py deleted file mode 100644 index 37bf771d13a6..000000000000 --- a/samples/client/petstore/python-legacy/test/test_store_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_tag.py b/samples/client/petstore/python-legacy/test/test_tag.py deleted file mode 100644 index 2c3c5157e718..000000000000 --- a/samples/client/petstore/python-legacy/test/test_tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.tag.Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_type_holder_default.py b/samples/client/petstore/python-legacy/test/test_type_holder_default.py deleted file mode 100644 index e23ab2a32fc7..000000000000 --- a/samples/client/petstore/python-legacy/test/test_type_holder_default.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderDefault(unittest.TestCase): - """TypeHolderDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderDefault(self): - """Test TypeHolderDefault""" - # required_vars are set to None now until swagger-parser/swagger-core fixes - # https://github.com/swagger-api/swagger-parser/issues/971 - required_vars = ['number_item', 'integer_item', 'array_item'] - sample_values = [5.67, 4, [-5, 2, -6]] - assigned_variables = {} - for index, required_var in enumerate(required_vars): - with self.assertRaises(ValueError): - model = TypeHolderDefault(**assigned_variables) - assigned_variables[required_var] = sample_values[index] - # assigned_variables is fully set, all required variables passed in - model = TypeHolderDefault(**assigned_variables) - self.assertEqual(model.string_item, 'what') - self.assertEqual(model.bool_item, True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_type_holder_example.py b/samples/client/petstore/python-legacy/test/test_type_holder_example.py deleted file mode 100644 index 7a2621494857..000000000000 --- a/samples/client/petstore/python-legacy/test/test_type_holder_example.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderExample(unittest.TestCase): - """TypeHolderExample unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderExample(self): - """Test TypeHolderExample""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_user.py b/samples/client/petstore/python-legacy/test/test_user.py deleted file mode 100644 index ad9386b6908e..000000000000 --- a/samples/client/petstore/python-legacy/test/test_user.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.user.User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_user_api.py b/samples/client/petstore/python-legacy/test/test_user_api.py deleted file mode 100644 index 6e8aed4f18c7..000000000000 --- a/samples/client/petstore/python-legacy/test/test_user_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test/test_xml_item.py b/samples/client/petstore/python-legacy/test/test_xml_item.py deleted file mode 100644 index 121f1ccb6623..000000000000 --- a/samples/client/petstore/python-legacy/test/test_xml_item.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.xml_item import XmlItem # noqa: E501 -from petstore_api.rest import ApiException - - -class TestXmlItem(unittest.TestCase): - """XmlItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testXmlItem(self): - """Test XmlItem""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.xml_item.XmlItem() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/test_python2.sh b/samples/client/petstore/python-legacy/test_python2.sh deleted file mode 100755 index a4faa81ca716..000000000000 --- a/samples/client/petstore/python-legacy/test_python2.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy --python python - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -e py27 || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-legacy/test_python2_and_3.sh b/samples/client/petstore/python-legacy/test_python2_and_3.sh deleted file mode 100755 index ef758bd4450a..000000000000 --- a/samples/client/petstore/python-legacy/test_python2_and_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-legacy/testfiles/foo.png b/samples/client/petstore/python-legacy/testfiles/foo.png deleted file mode 100644 index a9b12cf5927ac757b054dd875ee137c2581f69bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z005plNklH1~87DdzFiA2XC;)~Dpo$3~298uzpt7UB?2C zrfPXaKqE40ylK3PysV@&`KFt0-oA3>N*fHwwj}%@A;B=D*V-^3rG!ZW76I^B9@-KC zfcx*if9)N2+};ZUfyS`GYGUP72QH^lJR<@ck#YP(vYDU1^7d=5z4ouR`v4F@Nabc& zLb)YG`lepJdcUe)d-l2K zyx+EMn+;9f>WF|wWYl=$JooJLs~>;-@g90(3kED$Fc@GP91I35VIa{AEG{nY zvw8F8{&{(Mcg&voQcL&x*|~mgF?k;cfR2d?c;u0XX7umh|K6qw9ud%pj2d_(Fkkrl z^Q#~K)3hGaAP9>gNm&_?3=;$k765@>@hSL4`-^bt>E}Z6H3S6PF%3arOT{xPiShm6 zaxDJ-3;f^iRX9|27?PB=Az0cLiU1Kio9=(PpI&~}St%btePp1vO#Y+2CJ+e36c-ow z&igcf^8ESphpk+>(vvzC9(RfzfDl4>fP?Mdh4VZjMxQ=?@Y-vywQ1HodVd5oBIA^^ zFc$o0{(`%wOdh5;vMIIOAz^?JV2PCI({a~1SD@c%=Q-O+LO>I}064#sRB;W90D~nC z1diaTZ~u!W`@d9i4~rm70kQ(H1R$V-r(^)1e){R~xW99MoJK8et3pD86hIgP!cuE2 zKw1>0Krj!2pkXD zN`p!8YmOYQIAhVG#V^j7F=NEeojV=tKz%-WTnrHe3^M%2asWp7z(xoa!_mMqWY}Q5 z@WOLZP03Y>fJS6gd+L6-_xm2_pMU;s6QUk=Pew6SD!BD)K3<5G%vs zW(dGyhG_$b*Vor%uQKZ(#&3EJo6C2BC`tuPL10!XU6PE15$%lxEZWaYWH42V~ z%W51sawPu46(2nC!V5DeuUfUr0|vqe6yahO!71WUOT=$!_^lEzkVw4#`s-7&`ex2( zDrwpXXhcR>5|ULVTV`ct9Vp(p8wN`N0u~s8C0H;7n|R>dff#&d5BszgAjyyhfye?| zYQuzl7P)~zA_7|h`vew{U=RzGR~^8_jq|YOz#g^Pm=O>vK0-vWq{Oh{Lr&;~mQtD< z3pb7U```aQck$xIA)8(O?s859!zQC~h}EG3!l5onD0uj-5)tzFj^gdjP1CGs3hPBg zwoGIYQNZul!~D%}esf^w&Yd8@zhMM{Nnl``R9w@x2ZZ*~*#ZkvR)Hm8k{Jw4%Ds_* z$;x%nd=55+a{@C-w2E$p7t_Yzyp|mh04W{_)JaW}5k&$^-dv1j%iet=9QcJBrKP3G zul;AAe59n;S34~t9~ zEFtZ)M?n3~5bAM~AwIo!RWy%-1cL(r1VNGnlYn7akOrf)GJxAQ&c()qdl3bxh+xv? zaY%!)Y15{}xVTn3!@D6c3)dBnm^yXpTpiH#S_q-mffd$D2+fFub3>?FYa?6$H8k5| zVdw7RsG0_FBcKr(jRr8Ps;XKhCwDra;|SXI(3ZxzE!tvE>Wye+Hiv+O1rubSqJm)u zHPtID5FKFRN=ia@b~e(|(~y#! zgcdDZf{1YF;32GDy&A8)@(<+Z=K6xDLb%4hBDVp{-p#q8d-v|IHFlM2|6Oo1IyP(V1Ssp;!)20KQ?e5i*8j_nrMUbJow|Mb<(Fq%ef3rM zT5Or~=FR)pZ>Rijgg5(9jZ0RIWf080a9^L4l!UCl*|_40ez>StFLdb8p~m0ir8%$Q zfj>@lVkTY?)1R4<(Hn~vzd;fAq?Uk#nayq6wq3mR?VM-+^rt`d(B|T?qTEA=4n?=L z)U~~O^_r8GmiA_ReC&>s1*}um%GkDT$Hm#1SsxoP5CB6EIjm121AjelIQpJ`E+7mD zutOKG+iO#F^S^BSFXrzoK!AkJ>|)2lVP;I6I1#gE&GN(&T+j=(7*K6MGI;%DW@h4+ zTW-e1mt2gvxY(2WE+a>b#;2ctis0;tdmR#+wros{i;LSC0gdAX4c|s)m|MTy*6;f3 zuYb3=xHtqLye40GlQMK63>h*6Lx&EX(Y0&Ww-b{S@(jZWoNDFEHJ^Bx_Q8kD-kDWJ zMQXhoAV&{_h;i}hoiU@!wTgd1isBhulvWqRkN^vbl0X&4teb;f6+bH1#dc4ES)=Nn zxhJ`l0hO7N(#_Z~g#`-zGc7F*lP6EY)%~xA5ViLmD=VweDdns%*I+}K0G@pEi8pV! zam?^Y%Jl@nLrQ7Re{I3sDO0A52uGChnvT_59De$4xZqS`Vj_O^t6#0XX2{@QCnY7U zG7O^vKb65S8C;c@SAY@Mj)Y0-gbuI-3;>c4XT;#0UgOcqXaxg=Dg+>4_}HFxJ_KQP z$u>;b@NeiWiw3UHf;aNT4lK*EfdeoM!}(jE^hAWDq$CU)GzjG3o9p zm^W{p&l>W&DoII6$X}Tk6^UsaCt&E**~1S$R6cw5oEUdv4IigJ=(W}OtRmqCJCGW%pz6&LRUNwtwIgJ4){{-&Nc2*b}z zM*!rcO9O@kaouO^m3yRsKrk@*s|EPryUk!hFkslOQ>gV2?1F@&cmqIob|$7x`xCl! z?OZR@U0GR)PAO*xU9@#n@B(vg8SW4%UnK3K<2K0_Q%PAOROTvIr z=K)aX8ttMsB7(&X3Bp6)yp5%M*MkN7;uqfHF@MZU-RIV=TVu+UDY*HTn;dthA;y+1 zU*WP#`*|ql{+P^=Aw%%O%;y_z7NyapT$$M%KK#0>mHDfJHoOcIyC5gJUcH8aKy}|S zT$N(@*h#3_n~{-$M<0FkhOVhy-aJ|$wJ`%mWo2c{yYHM-viPkfh^it~MiC54Sz{Im zL))d{(Q}5O3IUjGC}yZ&+sZKNOs=Axs0DCkz+^(1aj)pPvAZ~a)8lHsA7pI zC>Mi+NMKrjLogtSA&Fr~VFLo8W3xC6I`e$I_5C{KMhSwDminon0|ZsJf9tPr!yoRu zuU;}e$20o(?~i%&<~cs1TgRf-;J$tPQroo)FRmQ1G~j0=rX+Pb;GXnWSnEJ9?vW!$ z;?~TPKKR}5?wOLAo%Od9(Q=SdngNFEl8!k%lY-#Iv!Rzzy%FfRI zTLd(Yv2h-L@R0*EXU=RH4m8v$ul^n|U;tit@wpRP5S5jc`2346F?a53$on)GMMXtn z!5|#ZBm71TP3a~kCSua0NpFrCHR>0_q$5NWkW!jL2pPdY=Q(z4S26oO!(gmt6^ z3BZ5?UP%Bf2{sk5=!}U1#eg%{x^D^~F|Kef)|72iKxw}}vy$~%yQvVZ1U?b+UHhQ zR^q*P-^UwoEJ99BPDort|6LsyAUI|c3?NU({Rzv3&XR zX|rd~j`3O!p#bDh$5pTCV1xy3H|OWp#QTo40(0 z7oUF-IXO8fD=Tw0qBmx8H2no{;I{h0C?l-35Z;~e6WBsCMFK|?wylYKB3L+?2quZ& zcKSJf(XNj}A3r%u(jyj31h7DrZE5JaGoa|`OwzFylq;gZK}b_oz}oL&*_s>z2Kudf z8l`~>pExlDAuB5juP>b6s6k`eV~^vxXP@(}3&;9n#@6lIS~qJJRT=?}Fr%WPGXCsN zXO#r&E^3!VFS<>eH=Z>A|9D1Tem-W;d9SD^q0BN7_04_Q0T*R5pR2fw*00xr;Sh*rE?D!uR?EVa8 z)*%FlVY1=0JqQSi1A#;Mc>h=U=*O=yWBY$`ea8!MTgOY$(uh$ed_cLbV2RSe0en)j z6(8^W1||~%WI-CLX%n*mguwI9zvuyVMtpocva+%;e&Tp!^y$;!>DRM5b*g49DB#$< zdGj@m5i}ay(vVV`NeRhS-XKu0sTLa>i;bHK8%5e|_ny7@;~)NrWy_ZNz%5j(L4*WS zL*10>>CeX^r-jR&c*SCBYISH9sQ&$-^M+zj+f)#Hee9FW6dc@zsoyNc*N65w!A?(~ zM%6ckExVngzjQoSMB}Nh*CC@-3Ic}2t|R4`wfz%(T(TJ@fl845dTpJm=1r`$JQzXU z>izROYSbwF`7e*7S;J*m_9t{qIm1gP^isUT>73s3*kaOM4>0=!4h z=4kgwAR{Bg7gQvMPYfm)q?xPmPS4+v4R;7W?j(Cg63}RTUh!$H8?Zw1( zb5Uj;h5-|j7$ohWD+E{qAl0Ew3PV{6f&eQ37^+9CfQet9bt$$V*pD~9UkhP#OQbL$ zZ7R72IX}osUs_xTO9O`L0;d6U^ytx;KI5r6u{@-d*t>6^Q`o1oJTWbr?>|ye@kY-J zdX4v5hgzA;0wXCY2?eWi=_d&q!NB4D{kDm>^O7Y?>-EX!50Cwi$*nv=`wk7OChYZbh;9P z1p;I_>fc9QK=uYEX0V6`qYA`8nRNtXzIYjXj+B5{C@^3NDHzO3do*B3m{PTIguPMJ zdszSrFqx`tqivb!ir3(5QWOc5m9dX=gO!CAAj^rH=rVq3GhBtGl+&GlB(~LY>m9e_ zfj|D?m{#WUci+RJMQ9~`M$?V>Pi+c5TL5&Dx1wcf2vfBt;cKUf>CPnZj zvqpLudNUg!SRw$TC`|wQUHoU?Drb{ww@uZO7zh9u+O`|o$DEGDW^veAQHGsI%J9+t zEjVNyR)-3!7LFDPz&@ds-iHN2ges8J;viVo&o86kj|sWu_Uu>z(grRAgv`u7nE%Fn zA7EBiR^rL0ren#QOHfo)6iU7$Wx*)RMpfi0H_dS7NPrL^d!C%Wx2`ToxIQqFB!&zb zf~WubOzUtm4X0%GB=}2ufB*QyPwop2;CWBx)YQ}_1sM9;$B(-OWXxEqy1)o@d+YVTK`8cB6O8B(*45H8!eQ<-2k> zB!DPpSdy^&NGblaZ?&y94oGR)B`XACfeT}k@Zfm^(6L!-0K$oZ2uPH4x(rWmU4bQg z*8!%0B?++O5rPZ^m|++utbhe!5L$_5xb%#3aph^}qD#y6Xd4r+tP3d}>txfx-PnA1 zFV>W9$A5qP1_!MQ8)(Q0oT{h~BLIQ?+yYFR@>@JT{YhDnzfwH))O6(K^GZiTI6c9onE~+K&Nx1|=&+Ji+bg<3u(5EA->njZ$!qR<(n6)b(rBw$YSU?b? z5)x4mkR+5u094hir0N;FN^?X4LN&# zJ9gM{09)8bS|CFpwM9D++nEcNFvC#Yt2=inAR)+Y)V$@;UNp1QtChrvvfpQ7LKb4p zSk?3h5{C3!GJB5vh=;#^4~zgz))@r_0FoqHi{|*_c>{698C{g#CkPA+mI1qb-ph^w zBnT!HxlB>gl~}SA2I8Yy;GRyGq2C$Fn6mLLlv#&7@ew=bAq>D)izAzXs@5_fgq^M? z!<`C?%Pn1P);cVg0{N#8&JV#76!t~byK{(|e*ufNXCD8Lrf(I{>qHN9J8 zhu3xxbk}Z=UWS0Q{cRB-ToB(0x(-FxdDJA8tN0bFbs|Gz^^e6$K9K@SB8LIX=5X|B zmF%PyEwH1@!K5sLsb9a1vOp;Wn=0iB3&PHR#G5VfV%iPp+@d`s08=n5Ettfx30|S< zpfX7OLjePvu5cH{or78FH{!PS|G^LPAcP>rJMmOiyG^5%Yorgi#OT(zF#at3tj*cz z(d`J<8RBho9k&4l%9KA*QwcSBfG9CaCM&b)*b$eOHLrcCSK-JOopcotgzK zm0rT)#c$#FzyJNk$!8^hLa6_~J`G}NFtfRN^X4I5p1of|TA+Xb{*hf?%cHEU+@4>h z$W3;e!+;Q*nU527_i?((k4yaO&$w_lp;>sTZ0R-5BX#rA52qxTp_uVTRsfheTBnk<>;I79+~mz%bZmrIPD*SVFlS0Vy%3C{Ky< zDAa;9Y*|4DZcoU@g|TNTp=kT`H`%DA4WRbjd96BP(%JpgBc2qffQ0~Aut?yk&cm?y zqT4a~tSfPDtM)bl&O|^8r9%SOa$=G-`+U!R(4x)Egf7k7;pr~J5N9?AJZWK_y3Q|H zh0@Z}WbeK@GQ8QvBJ;Z&yd&1&DiePox{@{rPU=Gl2n7--)t7EvVZU?OVln&?ws z_ev2$C`}8tocFLu*y>smTMv8(iy4MZt`Z;!0AC&c4*BIfRCd8oj9_6Yle}}Q_86O- zrQ#))1vZ3gG;I^MYGVsn%wRGwNOzx;PF1oBnCjFpv(iJY!TwMTR@PP@1JV`C9(G0=;-X^QEDhYO*5Wr7 zPyR``Cjej=M)&GYvJ=sSh>V(zwQJXg5a8{i{XoNGHDh^ll31xcTLjL(CGL5{{0sOTNGXwB{J$Q&g8fxY;zcN@stGD7>EecF6kyP0oRIC+rsfypCqyYnjO^0@2Lg4}wA1Q;yjMYCDIq?8V02_*_N`i64Y3Hf72c$Nwu+4a_ z049xE5DAh2dy^{g6AWB-+PR2}ic#rj2@r(+{TQ1M?SZgm1^@|*$suP2q?^hOw%n=( zEs}~!YlBCnDQ)m2N3FfN8Dn?pRv=`s(m}Od{rKYv4b;Xk>v@p|Y(#G3i(iwfgNt}p ztHdU{#ka1<<14KGlDoSGG7 zS?I4O06-ABv}kA7_^bCM7`A07K}6Q^Souv3G&K4drV+<>!BDtpeI%w)HzPSY8M(Q+ zHYHgH;grG^NZA%{Nw+OVQG?nO!NS(FumhNaFs5BktoUIwzCQH5;&NCLWT=x{2SWe% z{Wl)vE%lfo0Tu$Co1fv4RIFQT3jl;=yJVIU0lMI{WUMaVsld=uaTI0?#g#u|){g%v znM5cO*m=#{;>N^Y7;;8;FruNFGgyjFev-z#rmI^*2|*eRB>^A^hSf0ZNYp1-c+jua z(Ha0<*z3Z`4zGjJty@=h(}nQ4CnbDD#TYEL7^N1>sbQcoKyHNtCp+I*^E?777pp5^TbwyCJ|r zxk?5M2x;NlLwoSZ=A{_3_El^-xZ84?LQ_#2Pk}Bi z+hbPx4QL@uuyF5j6#*azh5%c3z*6%! zoblj#3%2Rr+$rak6e za0@y&Z|l5Y6a(OZ!@Pv0$Xd!haLIo4(b-*-u!1v6jzpi0U{dHtO?J6HNq{6wsLgA@ zKmdf&z#&ZBFdv%_?gr@OgDym@=;L5Sk&3Taw%4eLaAegd8?-?{gNOpsk^x6Zl_-SZ zrJ0M7QM;pk`}U#2#ZoaGzdf)|=|Ttrk`@GN$hfoxdUgNRfNh;b!`*=Go1KP#pFb84 zpECsQo5!OH0RYO(Hv+2rnldcd(aSXL3`w1@N9i731_`^W7T6jnRW&6x<5Nh>(HfOd zO`l-PA_7vyZCI(2l~*0aL*Fc|oj5J&Iu`ZQgeL|h3DMEf2kN`pwL!>T3_cvJqv34` zw0!xyksV$~LBFJ=BwqkfX>tmD@WWnR=oqlAhv94nl1ihrKC)=Gh>nW61ng{)!2XI7NV{1z zNrq+E!-@zv6`;l ztXZ>zr+gq309v$YQ4-EK)+sMm7Nu1ciZ4KnDo90XK9o!~vmw;$#AixF)CM<$e!}C(n zC$+hM9Kj?hQ~=vH(D?ZHZ@oU7TXSN9nNVC@97(&@(YW>YTcHJxwaS$= z)M+|z?8oXN=bf;o^c%bA z&nDm5KtEx^Efq)GXQxykl!(6Zo^(3sr8FMYqT91)Ph^MJ!RXTYJjBPxyRi+DYGVt= ze|E3NkAXvq)MXb)DIeY|qo+(}#msb1YRzaA?AZ)<^%d&=8L!toyBS1ujdeVY>km}!;Eq^bv!|P~_88gP=MUdUP&|-;l zs{#*y^RCj?ly;YQNY%y6(D%!7^f*<4l}jJDgd5lWx>?OY?w~AM~fuS-MtzXEEpgJK(K^#dc*XNO?IBg zLc)+htZ0s2t&&tr0&;_^78vUf@3uKCyyN??@s>wG{c31!wn?5-$-H*ug_Fm&qF z>623)G(4u$hK!7iYJ+tEF!$g8iR|t=8u$MGcfN%yp~P}XTKMFLukg-yg-Rd?0+vnf z*PID5ge#B>Hz)@H7ORZ~OFA1tse&tT@q&<|OsjwI5tj%9q$t$V_Sa$IgOaaME)OX% zl6EUa-K*9xo$B0^wlqiuG)XcJScmZ84_`T13xln2&skei3^r^%4Uhf|133HKbKXB?LBkuI zv41ZdHELv4aG=Kv9EF92kTMe2sEZLD9fezOz16Yw45@eIf5iww{E@tlm(5DW=TXv zS=m_|l__g@OfPoa6=p`x(wxW+ucPtDseeFR>v%AP6CW^jX_&C^(B>Tc->%h)k6)j$NRrhKurGcoSc}1 zW>L`xPf5_IE(Mg7l=y}hAp8U`wO}53r1OjQa-sM z1(+C5Z~ZUEZFmi<4r~K)mCB$9R^?da61sGSsJ1X5RnwqK!78gF2~~!~rbD|hyXX^) zUjGl=_~k43&+a^w1rFNl#I0ntOnXh(r|N@WFU6KayCJ0I$OjrMYb_;fFmS*+gehAV z+106v=&Iv2BrQx#xfl|*FpsU`t~c<1cCSJ4ky1sB3rJYPRY&g~mtwmb9MHGJKLTKhDy%O578BRa#rTa2 z@YZ+hvFmUtm;_8q!09gUQ5I)bje)8l@zsIv@y>Va@aR|XVEC#RasAp?@j~&(*m7VG zED#K7!pX{z0l~uQccOGc0}w1wW*x$W4X-Snh!Btx1_5hIcH*gRE0nSrTaZzJuv7+x7`XKGb9^1s*e>f= zfFpdsr-R3enJV$|_uqnT?u&X)m)<{U@HM~Y2B=b3*V%x4h+A*Hm6yEvPSB%nO9N&? zQc?n@PW>Z(``h24w6xUs%-e3e4O1VuKeGEza@>8_WGq;)z|&rleLlAiIRUN|D2fs&&JdAG+d{=G3Tewz)%Cx7Dbzs0ifGijiXl1s* ztaRP`L`eWj4P4Svly7!Bx9fO=fJBu5qAfU5e6X#huMh3ULtEalc_D1OW3VeqZJ}Ql z00_O~k};q|8WN)7Q7RAPlkdL8;_ugjpF=t5*+TKIq9`H6soBf*XpL$M^7EHmJAA}oM{L$UVcZm~ON8;N zmTTdj#Kc4ttjvq-`dS#1?w*2q^X54l%Axo}k%@GNbxE#}kA990_7N-B!jMYy!L&=w zz4tRX;LWa>jIZUPPE+a*>tM?cvKp9@aw%?1=mVBf@DZh0cdl0(%LKWg0yiE&cI;s8 z&NZ01^AnU=6*f;qHGZ@N04o3~44X)$;w|p=s`ilTx)=r+0b;wKn?w{dm<1O1o`8g? z(~q$~EG1`10?|^U%2ZjRHKp4yzHlzI9FKRd{_uxCto`+!cbwl)Yo)>56971`bLWQ@ zAOynud$uN`w>Cw`JD3^C$;px3UQ6TYXQpHJ>{-xq`dVGvwAqaem1;FWcE3~gJk=yw zJzw`KVOB8>uiF{ydU`j3e%|QOqp@Pee=%s#Ap4MDSg5j1c-8aNf`u7dS76lVuVQuC zw+>@e0gvjJBBVO;Ez&(*0n1_#RCoI?%8D>?{l76|$Ga%w!wzU!Hd~e10-M4COQqi_ zz-)jh%I-p^tQ!M1<(`$$ux|1^>8yUo1PmQq_O?`_fC9A_Jrr~=paQ@(Lk9o4LE~W! z;ht#ggPF~Q4vAGlxQb5xQ^y4ejkubb$82HNteLoG@SwQF`tnBPl5fQ>XqBgRU9qi*NP6dLY)VQ)yq#NY$>B zCU;o^NQgcIV>{gJ{p}T9v zbSM2R6h&TGD#h$|wbXhIIIS0>U?RW)J4h+e|IBnedhS36T#n_Q=<{3Hm8@&Zw`1J; z|MQ*g`ZJS~l90bLFG}y9hUn*7FQ5_b%jw6S|N9H;{`99mrF-2D*Yx$|{e6|N0i>j) zATR&Zh@NO2jr_a<+;!L8o;n~;I|Ar>38gXW^eh!>GwbxN-Obh0(Mt{L z@A^%({cV^TS6?*%8`f=r6sj~`7iqIcCjW2}aqJH+{c9=o| zfp()n288WyX|6;SDglZ@TJ!ek5EF-we)tN2RIUfRaW+6vx&^t}4gqBqkLi$sdpcd| znhnROA5-9^0-uHys4^rbuA7V1<=YU&Y7Sj@knz-0PrZ4=jn@x9mg|2?#WaHd-nw;r zzn^9IU7`NX&({d{pp?I>2rjEve}?uQ+C_GE9gp3+_uz@YJc;Ew%j`h3@b}%drSddO zk^))*Ov}*;#KyKn-@bh@?Al?t?9xjR8yj2GwS&o%euvjyd(AfEEmt(h7Vxp`^d!iz z;|pq|McFMP?MhG;oU|)dO}j;;zHXBZ#Zom0y<4W>$!^yo)@+6ke)tMcZhH^kR~%6F zF0kD$Nw5sJBG&>VG5R!2I_GlqYkjU#?UEMYp^qOera^YIX;TQS*uMpnHoxJxJp%q7 z$J>jxH8%_+&`=%Y>lHMr0}p046FVkVc~3L9B9QEp%JKons8OTv^fS{VJG$OomvU?< z+<^Q~^H5k=h#$*J9bSeqpH%>}`vvEtWs4RVG-x2sKC2U=qoYsibLYJD3jXrclQ>j* zP!)pNG-`&WHax)>AJH2*N_BFwCHgE!Do+#8ba9xnBm{0tz8K>YG7!bls3eIfsD85_ zezzGP{`eI>E8l@#6(!DL7Hc*`ued~9envM8XqyH@3K*oi+1m{fj``iBt;Noyqyq-8 znS_wH|Ni&q*E~M$v7TN_!;NM5M_gPS zHf}16xFtWaaip>mH{S3I^9}sp1&wy=U#r#q1p) zD`qS!>O4GPSX^A(T$ohR(D$O=Y2@MlzUG>NcLi6v`T;{YLD9u;y%_wI8K|tR#JkJi!{7e)EY`1I z?@LU5bx>8`7w@G(Lb^MpJETFnk#3NdM!G>jx}>BVq`Mm_K{};FIt8TRZN9(vW}g2! zbBA;9Is5Fr)~A+y=vUndDj^{fK-#>1B?WC92zuyE5g~g`aS7_gTK)jYQBG-L-8+VU zT{xY5m{H@lOGA8yIn&bQ#I#ygNeI?lXDI8>NV~j@5va-JsY)S%@43tIQdrYxPkQ9! zrtcFHUbl%+5kTVy{Ft*_qvYpjs5PbRBg2b}>hS(&ygy|gH`Tk^aevm2XOtryOB#4{ zvp@#K4^cqJZCURyk0ufPva{OTv$*tpvmdq!V!HxH2gjXTHX#M=OtcD2xmT)kZO72z zrfxZE>}1HHCT}Xkn0*R}=-D|fPVcZ;Pi}@xH5ge?h-i&3q}+~I3E;%nt?s{fN_9BR z_vsMcjdXPyZ*8aLRLiUO!@|$iym3wTeez}JQkr)0lmkG=|A5P75``qD%M2jS?_D)+4Ltn-%%yzK) zvuHxbm>twYD^=W^GX7wjP7fr6Qna>FHCZ0lHI~ID?_LYwH=Eq#CG3YUnHRORS$c_{IkVtj&3X;W!{-|KO9L8#3SF^o$1N$wkRq*um zL@XS1U@BO5O?~QTYQfB3mF4B%S!ha`B}q$Fv~ej5-dZMo=TujCCnrkyGst7NO}xF~ zS{}#0I$h-O1D`Apb0>T>1a3()e8oyubW@sT(C%>8bfm{14n4yC1J?9VQO6;?>?({4 zAR`(5Fmo`*S|?&Vu2;RMmm{S7r>T#5I_}2(B{V(EW`^;7esK?tJrSVjz(vBMl>Ek$ zEfxCHXY|Kdb5c&*EySifo>yJSWP#sJ{oQYxQ%vYM_@AX{05|us6|5iOF;xE^yc2|| zr$&{!Ff^*&;!N|R6J4K^`n+#l9g-RqRo>U%FW_^Iyr9odDc)4C-u}G$cjzD{svatvZ_6Cb}FJs!bMv(djb; zrn9T~abG!JgM`4<4r#0JwFu&dC*N<<>a&0DA70_4nkEg47RoIx1mqWIO? zvKk+|jo&}YBSHyw?V2uEKWQ8Z{>?w2p@Lh_#YSh}+%k<%T~O5_e;=xkg<%35LVPNI z)g+v}h{iMNg%~l*+&+5^`YP271*Nk*2NSKXHnt1R!nLJT`G!(rJq-E+54x{ehbk;F z+-xZzfw`7$gQ+nc6D^W@dPKAKX?Aekp_BnF9Y*-_ovc5~kF#@{|4KvT!pkEFLRIup ztZn=NJhU~^kWIzF@M@*CD7U?RS*?5jPgJ+ozSqw-IzqO8$M?bwySI4QrLyr^>DzNz z3eB#Rq(1Ah@w3DPsL;eQ^kbExuQPgO16eBg*K4Q8#7;HoEW0tFr(kOsS=NX#|Z*Hnzoo1vM_RM@&^Nk5WcjQNh7M&a; z`Gwk7!bbyGJKh(C<+JnedTXKfb7b=vf*9o{CpD7>U1VT=b>&|5J?*l2UaPV{*r<)y zfn&5wrd|AVIhFjN_Gq*ms;Y|?UvO|PF3w-2rC5CoKUSW&dF-AXtPXv>pBcWn zY0!BS!BD57x4&||M)WN!tF@Y9r)0I3jz6mh<)UVg^l+mCR;xgAAGx5YND4y5L1?Cb zb-}2~?6Y;%Hgl&&jMlKi+<#;Sqo5iSS8XzKFKe>Up&N|V46E_Bm25Qm_X7{2L?C;~ zGla>Xm#*BU`{sNrhlX-Sm?P&q5`^vQNrc6!z-yum^iZ>$wtZQ&;c?R*p)QnHGYe z`sVm(>SLn&KGhj@XQWta%IgyI`q?%h&|y%Bh>*Sb6^faxtQY~}JuZBI6lARN(IJ>m zSeVrJ?lOjHWyq=|9&O!SJgjWh!xu{U!3qu&3oDaP8b?QNE2EG~T%YC$SKdu1eCi0@ z4ZH8Fa8lIMV^uHSVORIMP37A;ibyD!N;kjPmBX0g>)-`>=%Xi?K8q10NB^3U>deK_c2^3e-R8zz zKNoc}QG#T$W`AGms-U2-Pj6$r%yaH$SZgMW4`pI*{bOL@!}Jbnd=deHq6Hi0zoW%` z#n+H-g5vC$y}i8#NEY;D*Ad+lL3hXC{gXr26&kHl`>Y>wQ*8N@_ZVZH1-Pv7PkIDG z{-XE=_V04Jh1MeWx9I$vX%YkUJZ{h)uo89M?a-oKSPKF&d#PrF?4#sOq(ehLf8hKf9d{!dWUqa^zFS;>~dhihu9H8e<0F(%r#t(MBPs+s!~~ zt@{Q{W_7L=vAGJ6AV8>3wBffnA@j+?!a~A|jzekIX>Pc^c|Jslq}p+dfJJcw=z&{V zm&H~Jn4`gCR#Q<~-?M<#Ba{dZgh7x>)&$3GD!>V&FE3r_8i;IjyY3FkgnD%dT+Quf zV64JKRaI3rtFwy)Vh&kF947*X4#J{_N-Xr97ip$u$244AnP=4W^`jype%=@}=2wq;B zTIT10EQ2<0hD%QIQHDqFd$eOpMoJFKE&P1t?A5l*jYH;`=~&);G$^Logbg>$@uR@q(uLuCjG&H ziUvQ6&|Z^5*F&Jvvkemy!`a#SgP`VvER>Y1<}1$h1~kGRvZ5{-$1^D^GhllLR(U~P zaO2)irM`zJwnnm$0>AFB@ULtXqzkiuwyv5He(iI5wB zTnuAmU~ty=*7zb$x*pej(t22gHF@c{5s-hRvvvVgiJ^^lOPU#;JKywJT8^d$+uV*H zfGuW5tl~m%*NYH|BtZwkzC9<`e=Orxu#!OVO)c@u?c-ozWOO<`J?R6&?I50(rc5gF znZA!66Mai+iz12cZ1%l3pTE+rWfGE+b>)wV0+ay=zhhQf3mjh0qZ&TzceFxC_}#)@ zo-hgmdFdH2S{om?x(<#1>btu-%ww%@H>8$Af51GVNOD!RG{iw{LrvI$y& z#5r+~+oVGWYwhW4HZld()&`W9-7uSkK^sj}gigE-LZjuAa&f9->UsgX% z!A7`ZNpxvC2NWhQ!XV=Uo`VXM$_>-)7SdbwUAX4hJ_H735ur!tx@1vu+lbJx@_YkZ ziSLXYerfEHa#780T;1^c(I~!~$cPlivPhJQsvdFMyMb5^7s9@PyVCCh5F(-yav2ncidrss8az>N^_=qCzp$vh1m-7Z0> zs>vLV@xrr(M6!&TM5zDK+Vf|UGB#pH5O8zu{zc1Eqp%7&~kx z6b0DgDcIRDzJFg~^EflEw^_p#a6e(___I@Ue&8C41*^dl=@lzY>S-qB6~qxHuMjRSF5WDT-))xH34|O| zzJ`Q{BejwG-E2rpMd7m>An-y8rV%Hs~%9IH{PKaaO!9MYDxFC?vk>df$gf z1w{Bl#L){-0#INQH2xJ7C4UC+vG}V%(~d?Zg52kaU6D2ZxeI#&0o+){ba?b!08oTQ zMn;zZ9V$suH8hOLHuB_lJ6hPlp93y$WZZyn7{EWLW#~%)3?GUEQ`NkjVZpIG6@GUW z;ahM~j!whXIjYlin%6xqj&hNQv%a_9|BenjeGeNWdF_6?{F*A1H+4H%4qsob*s$6j z`LsItH{)99x#({%xU2uIrB~wkGK$KQx*r)fH$M|UZhmBRurFhtG z$Yu+RK7`Cr8qa0t+eT0Nc8M*O16eEH=Z8km@F3(um>l?t z`(|M(dyTR@@>Z+pIeOdLU$OmkEC-eRR;x`_-+*F>V$aXQ-rnBajfHdx==Zu-(?!3M zTRRcIetQQoUCZhank&EEEb5QMQ~s~qh-vG>mnw6--NGXN=XzIc&$^2vg{lQtrUWNh zLjx@*KT_lP1kGgBNle6BUe)9=^nVLzA&bg;2k;b9pMOI$jeFt&lQ{=R9S5aA6VzbA z@b$W=j;G>^6`Ooihq)jwQ^x#4mu{5%crasZRcut@Rst+EhsDMN+;bYc=|C6|p?WdF zU~G%jj0cf_FcOR2`Q9dJT@?G8>>;Et-=d^2@AhUC@>O&{mS&;Oos7S}>i&0{0F=g6>oepd& zt|%#j6Zh1@!fw)z<#~-?AORJ6P1o|Wa>9b1f44C}q{%;8x(3<;<|`Gs1^Y z?X%L_Kv<8q+&X15HTiM5-CW)bfwx<`*^wf382)yPf*P60=*iyn+3Prn+3j={l$_-$ zk!ZBZVL;2}7bOVA_)GZM`t*pfUih|-ki;k- zMEwAjBL!~a^Ig)a7#m;bS+9cN1vrUWDtE!_Y`+FGf~Q@D%bLqv4P`^4qdvmI z!hV*(B<*q1|(hL)D}4Ff|E9I{!n zZeZy)EQlt;z^^`O|*m}I$Adn#WeHY_^f7)rKYk1+gK5!!nTvEnmVT(lfi-Jw(id;=lHUUni+pq;uvTV8G%iKWb5uj z^6Adb_Vx>AMzj)L8s4z3C|0(XJ|-@RBW+`@lawk9NuHaK?!pGO~Wqr z5Lx$l&p#hc>~sO7JUh_1y$zfb?QsJhA7?Mkrt_-&Ja1(v4Et6%tzo1TnNV?Vl$Dh1 zs}ETi8G*OPtM8XYsg0JLAxa;c-8%W;@hj;N?S_vyp|8oFv>^VopV(iHV~4fQJe&DS zhvI^Q?M&dvKIH{Bm6}D^4G(b;4nIKgFDN^7?mxlxcD{C#2#3jF^@&e;VP3>b7!$$K(?H`SV+4me+`m z{qF0xF=yIsy7KD$K4nd-UI?R_C>YVkI~c2dEL2o5`BKqdoSXuO4sLI9ExZVOl*=n) zP5DGhXt6-kYw#OHVOe6jg}(3XIMGq7 zbTn}wFvRx}#i1J2icvg7oyl!7@SV6{4Dc~@Mfe;YUbxbNS6JF_;x$a_Jos2)n1&}`V**$a`7 zkW`K)&i1RjgzlMMymHY8JJE#P&=gfh&8~S08cgb(cDouy zxyfpo5KV%Ic%#5)Un_KUsrsh?G;j$Cw(p6QvcTj$s8)fe-bgjml^ZN({A-#XgH5|b z7#3tfsw?$4Vd_XL0R_M44hc!N+Sg!dfi4Fm-gs1Z325@=7O6*gHE_M;`?$#o9|klH$*12l z>kCEg1DQR!aA4mi z4`mK?c=HR>qA*VuHaVcWEQ@CUju1LEE-@p_|7lHR0=#q>{w0;@owb;jg&D__S@E4{ z=K&IihO2+*flEcjhy?9>Cz4E)VtZyoa1J!`K6@K>MCHwT*WT|2dA3&{##cKQYJ3Ie zD)kU3dvgL|K+Ezt=eE6zvks8-K|Gr-SO|bZ!RbkqFBM~joj1shuelMbI3L^muN4lI zPdteDY~;po#ooOOM5KnUhBAa^qb5g!hfRf%`v-|qosW$fg3L_bOy|dL-0o(-c9PbQ z!7^QnIj+ddi~2lhbE`Et$Zz4Fcn6DW!Gru)bJg#-Vg6|r^^LArpd|A7`MHduqN|dv z!-h6nE={d*tbiNE`01qDn@HL2I0!6-Xatt%QEVw=XW8X4BlH5~9kc>@F4K=mUVXBb z*RE_FcV=SW_v5!>Jdo#3+Mcg%{4df4#zcM(h|I0^#BwuS!$Lr@`cig(Q&P3a&Lca7)M<_(IA1V>EGFE$ff7cV0w|v-270>C>ZEg)f{(s zAK6eg{kzewEw`vr)~=b2TdpO`_S*U}LsWF&;ZS2%bXan1z4HwkbwC)oc2HrkS1U#+ zhfOYRD^h$e2la(f`tBZ^40JbU5Murp(t)T!{{TDD0AonGDFH4^=N=nr=PAVSP8wP8 zOd=y<7ZIzPSyFVp$Y?d#eN7Md+nz2VIBG@I*A2wwH0sQ|1I*j#2?z+R0CWfMeL91P z_>pRdLJ6CVi>RJ9pvG<~Ch|Z2m70c{^ywn|dAaY{oig?}o+RFK350m@Ks)*3_Y2Cp zqnJ+FA@z~3ey=j+M;|)A&?UKrg4)R|EKvnxlfdKYU;Fw)!8N=j-A2Wakgs{<1%K+G zL1`QN^XJbYiFwR!oA0s?w{6#}iXab0>YaYNj+)sk_*hdNQoSbo(`%3hAaZe2Kj`HV zNZ#zSTrr2dh9`;XBTfYbC%^-LI;f%bEC`J|_*S#Zki_hlEI!lOI@!;}ih-$Q9_l!= zLBFpkh)^=g=&(`5hT*XyjDv@fX-j{S?HjG0pB}GBGlX#lPfs6VmM=StlfICntA{@% zX&E^A=fg&)rE!nizIb!~`@Z|cbr;ULOg4ciaq@CA{xbsu0bLph42KvshTAqd1Y zjWQYzb~*$a9$@YFHge6PjDh`Comk$!PE2e|dvdNeVQQOzGiy=sWe0zRGpLRueMC_< zR=Z|Bhfzc90zwfOWTR{{9oYuH_6wqb?_1L4tYEBE(t_XVP>nM=>t&rfUJp{<>SD;xP5-7Mpt?q2hi-0-@wlvuF_Q_w#4;0wy0tZ~#ve6-dV%IQ-3Q=(kco&-(AD_tg9$0Z8YPl}fS zG5OjO{L!3Z2%-b~f!tr?lQ#KU$IO>^W*IjN9p149hXrWMDvGG#Kndl-FYxDcn))~1 z5^v10pF<-fZ5KP~4q3#u{BUh}PcbU10mUCXJnB2&w6xq}1g`25rszA@oRUI8!y|q@ ziR>F0e+&qYaif)xlf;07dB0HMV!)>TPmFWaqY(~d0+1rJv#{`Bj`RHl2^@W2$b5o9 z{K;#Jf$qRZC#iJKjD?KED5JG=BGH570?jy_O0>2A;1@-4cvo(vh~o40&#y^6tmhb+ zJAN=#86E!7Enywr1K=qLJ$kfwDYQXQ53S%?H`UkJIlPcXaW5|~>Le`zQ`dQx?;Sr! zUh{uq(hfR47(e_%(*3K8Kj38LsNoF~xtqjON(b3zb4Fd0r}Rk`zX&}SL`baQUzL39 zFnbgbVD{;(n~d!8k`I>xp+NUSN~OR4?3md?3gFRUAAX)EExVn&6+cWZ>T2^Co`Cf5ZdJf!RWwsK4in^({owwL zAgQ@F9Q}>V=Z3%Q|T^Rx36Gpu%X6X;IAsFcI&owqT zq^@&CnE;Ra0;=9(dk&imk|e8NZQS!`I5R=`ts!H6BhyzbH|2Jw@y*T6RdaJ1B+$OK zyfjfCr)ubLYBt_g{Rs+!_K^2WBCzBy(g8kr>aXwR!S-F{IL+$N`;Vj_{RjE?auiu; z1x#2NCYXrD{?LRuNJfGuEfz|6K>=+0^V&5!(Gmm4cWHv#TSj)D1xIBcWvDvAP?Mss z2(6-uWJQ3>>H+A2uV-|3juOG>5f4fmz`_75ssHVTQMK(N2f7|Pezmb>>jH#o9lH!k6H1j9rlyA3Y5deLvZiSn(@7TW z!sKxucYcV`oXqMGR`!#mX^al-{V&aSTZul~6RV)SSRT6En%6I9D&~T!zgN3by<^Sv}j)$;jWOx)uXJ8OgCT$ytS%U@y5a< zBKSROy<0Rzx2%fB&y#;^-t+byO$+3I1aXo|Rq!O4*M^q*`i$lJN&d^i^@*6?*T?U^ z{6n47H6}}R*7SzN*Dhz@;5)6n0m`5GH$`G*u=`$=3QgjF20*}*?*@3mi+}VF3Xsfv z-qgmWUAOV#g zWMTD;$|x(pV6BvN=4M=svRyT= zoMN#E27e(|#Dr*4+4Y#xLu0_bobwy6L5=v^(U(DJ`~}Nr_gnt)@mE(Houb%aF!c*h zzP-&Pt+NOvut4{s(JDM;iY{LsvZ@9jgq7z1tF5O_meu1`|ItW$tfzFv%RC9<&~b%! z_wTsv!$P%<=TajH9|@>4c-e|T5K6r zJ=J}&Pc-!XS9q5k)9P>t8t^fZI)n6vVqz;u_iBf?x4ws16{`VxF8Rd>;&(--dp$(5 z>Sh$dt7V`7#`#a->qV8nD(&|qr|*93Dt3%GM7J?mK6eHZZ}1F7EG}i-m3`(-d)jZG zr-q>&G-(zvuiaFTW8$N-`8L)8WVe)BRKiy%3IhSGP*H4$=koTt#pF-AOPD~sz|Z=m zuLIafz4pYSve{T_!G)fnsHz}9o|n0MNf&H^I7>*zbwfCsaSI(1DG3WCDM3L&OW9r@ z2QHIt;j(-;=G|wvYm8N(s4>5OJv$#Hd+9(}gjP={OAb;y&M_@`5CAu7-W!aBv$07O z6Bnzlo22W^(j1c4DD{52ZKIAmTk?f?$7XAPjOzHo+_c89x0J-CnyrWbN{UBApd{IYIx{y;$2l4qF$)#dGaxfDT z7RoyxpV_=)de!C8cqahJ2D0bV{JEDFlY52g?%Zz4P5`MYNpi|ssvr3fwP3@Wfnuk13olrTH4J; z%jZyG#qv7ccQM0XPkNSHJ_#Lu?cEzH;WGd|r|{i&-y8__7Qm0$QlCb%dLj0!x;ppB z#sx1%t1~70g>42#u7-w&y7T&x(`l{LrO___$sqA;1ktU1FGXdjS!*eK15GGRU~c|r zZ-ov9;pb0Zy7(sEiY}Z&e$?k%|K}(dO@X_#fw1`e_-pIV@dQM?_L)z2lXPUE4Qxs- zBG#&>T1K~nQ;T($gRltlBF_&O7fX#IpX|QEMz1^FoNaK@t_l6Q2axu?%G6;{@YeA? zUMrzf#nyRG#B(0lXyTKIH)9g>{{!}u#pJqQXb&aA2{JrPF^zAS?hiX?%gmBDV7p#n}u zLr8ax0{%|blG`u~8obp$(}8i()Wii)Io>y|9L#Qm*FrZ#({hYjH)u7E=Wvuk5;y=z zW!azkK21jlgL(D#puwhH$i##$?{cuV&Y^X`$U(D0_s^vOQkUafL>cj0!VOrZFno}v z=W&%?#nWQH>&m{|ia-F*h7L`=iZ9LP2s9>}E7!@71%X>_r=5B(Td789MqPd#U!N|= z%$v1|A%broS&;{U5sE{9G_M9)x}#7({LMPfmQxSx&a!`3;~Q@7S$LFJP*KK4lMb%h zO7?oWO&brFZ5&a5|2m_P@eqSFR4E;uTV=OEJnV8H0<>3w|A`1?UUj5jZCH5ihmDK- zVLNP6WbxMLsRa*B-|;D=4;jRYygi=}K_rqe#xp4$ELP6$bR11(r~3SQW<6U(X9CgE z+IFdNYjafin+Axe9cMdsySZ36S$hvJ`eSdp`1Q+8Vr5yK^m&QreTh`BXhPO_gQXvW z_2(w50Qn;AiqIcA?%1~LBT1=jCWZ8W+GXo~qmTQ#)@e~gqp44qQ6clO1VS8q0#n$X z?j7#YS|5!9Q$>V0j-^-VX!P?f?IiaG?=Sa1gJhji8n9+Od)Djx>^82NmYqlRwQ?5D zIyB{w`of$ee1i7dn%4XTPM)`XMUXC9bBqD9NrYz5wr;nMlJon(gr25I;fZhWEB-7=T>4YLUhZ96gWZ=%q4qUe&sqf5pY`E>}|LfR=dgtz(Z_TT07SE z;`23|`+2c9Pdy)xf(s+ zZ>>ut>t15VShNZ#i}+q@fWEv-oOMo0U^o9O z^b*#3nsYJWJp*OlU0ZtOiQSp1_y4eriNxJpLy+dY93*gWVO}-CO!S#%)Wuklbq9Q9 zCjAx;ky7vL`uU)WNMmgK)%L}wT_YcsgJ|B><`J@I^qADLq8Z>M^S8IQe!DZC9Sd}w zrhf~(0k!RR@NK%y4G2)yEPoL=_S}(Gb^45=S4^($6!~ zYqc1NMSeC~+W@s!43CUmai#R!ehETMw{Nv>!(~8Ax%MB%N|*Be^fNBg(4Kq>9ZJvY`W&NUPE$Ru|;fiK#%pC^haE$n_0H6 zw7G2!(-ki%rUJCwfN{=yFC0CR0AgrVe^v?dI=eFElC?5}K-fH3CDJcnt+$lb`?CxH zNIihcL^*8EYi4@Wv7aDT=-=*UilG-hZ7L>-59(^VAxTa_Vd2JD+v$&4t;crRn`1Cv zqQ~K+9oaK`2OcVqF&|OJ=WHWl3)iO8{>Pi`U0m3P^~--J8tcFU9PNZPK*5=>oR7+5 zV?FfUKjT#}#kw8#du49krn%*>j_Wn9hjV_ub$*S# znKO2g4YVo96F|ibu(5%X z_~Cdf2Yk!-0%Y5R!=onk?V*Z^o-~Y!$*$R58GM-G2G^h^W>5^hsCoF7ClhEWdTw z^Q;HqH5hl`ET2&M6hiG!a5nOs%E`gZeEh3b>FqwTho5~u^17V{~L6)YCgR-gtR8xD=@hm)Y{??5j10z3w#!u2sPftdQcmFQq^yKJp=H&DX z1=&a4<3p$^_Ab1}K&7wgs~NDc5DN8MF`dVBC$jFPeaWtN@IdCQr}uRHsna(135Y42 zt^&$V8nUrU#_a45x>Xq$zpl$7n)neyCm0`oDhcX`a#wO>4LrQ$}1AtS=9EXyYE}ms2J4{g}9g6c5;u z;XH5QuH?uW-)M(a8nk*syH5?{x1ffgYU2v%1OPZc^K3VoOk|FV76zZq=Ok;4*5i;F zAXF2@?iL+2&avv6o0&~1AC8!}CM#?RE1MtWM$>u6G5(?237))~_m~g4_GH2O#tu3> z-lpS)-=)vpWyR`)K4|b!MdI6~YS+}uL&L-0gin&szjpYUh>JsmUw;vKvRnLoU+}qH zTI?*Xv4n9*&+{HjS@3)w)T!jOr6z~bnR5a9;K{^i`oUo?woy&t$JKRMPO+F$r$id@nDTC{C=4otogQXVCH21m)S^ zzarnSJm0Xg4t^o?4VJ9x3h(U|2h%6Mpt^i1x;IEjFGJg%|9jc$KV7Ws|7m*mas3bQP9GwEybZ310ryE0VR2J+t!#sXyj54U(99r4O10@7S?U4YpMGXc}- z>2^2YbnqWOmm|4uqb&i;N*hTx@7n1aS#$F#jaJAm=8f{x&5gD~mLSsBKx{<=R@OIm z`y*J;Q$;@bn#fwcq90Vv;7z_#l0dGcf&)dI$EUS#Vgqc)4Md->Lcy^w4pAWb+Mn{22 zf_2sJ-tI-U(egZU;VWWdlyD*f0|Cg)4^IEg4Vci+2xuRGc50!`oeXqgD!>5;B9^~= zvw8J%wVG84$Mz4LUPO?cUx?$O>E3>*~PFiPJJ)`EP`myb|tsMJdc_IDK z_vHVR*V$eVp~#uPLVTI0LoOmBVzo-obk8Bk_od9FS5;ry|424A_uZGx7=e@KT$_(g zynR=2Z#AZhFeXZN0fdI}47iB3OR%Rsxelj0gwTYBM8JesBd>NI(CX)bUY0{KGkN1e0bFLjGEok3-cw7ojtP_h^LgE%ozg^ ze6M8=H^F4)UxDaF(@3m|D53cbbs8y!NN8MbV(Vw@Nl{TK%U*{SoGi!g!&JJD_f{G+ z+(<>zqF@3M-@2}@ZdQ9;N%MG$k)P+*Aeq0QLdxM6cjb0^mHlQi`$*w`h#22%4^_-7 zjO8WlQg!MqHq&}O6aMl6!j@c{6mn{r!%22Ziu)i?ROy{8 zw_w?NGGlJk@wcz5lI%5G8&uJJczKaiFa91$@wyZE*5-VFsDz^^bvj?zavuKpG5C$G zW<(g9*$_Gk0gsDRm0`zDz4fO%TndS3wX;F!5U_#X52$x|qd=}gK~Fz?Z3qNl2NI#)AF(j(n>RwGknzDI2NI0S0tLH^ASmRh zeSrLC^Cn6xq=b_gh2RGcdj=04jaye zwp+r>iveWn6GFr4wz4+!*=-e}MmM&3`x!!2w%G^ADpNAS!{#O}qL5v+V&%LMY&bS} zSj&PIjZ1b#-gJ?98G;ebYZO~QViQ0?sW#zw9^c`8{qGDqR9LlRbodLY=bQ3BVA~5t zHx$>`*UyKGs;zZi_PJm_gZKVM@E%dy_|i5B(YkbP(B%kDR8%|n0oBfKdv_N|)lR+C z5r$T?7a!NJgDiuanDF$oEnyPm&w73Ae@3IbF^ z8LMtus_xYNEkmcY36?t%$Y+V`9oz`-eiQ~sIzr`K`mTYeT}e*N_mId*gfYPvvK$xZ zAIJ9JY^pR<^fdcK(C_#!TxWC{=dKc~se?g@jFNmO`5UseZd4G6g9`v`{E&Yq^h*GY)t?(Cq z7SNm>2&$Vkyt>} z;oB1g_Z(4Pi)fXR(2Zg1D|r3`i*cr_rJG_wBPt>~x`IbIcc#{S2;R1!DHh5UEL<0XpdoUBIQ8ekbWmRv?zX*@HBjfy1&3XHxc?%RJr>*@-nKQZf z0i)q9SkIgqv6McUCo3Ethb5I#*4E#PU(NloMj>A4QvGEF3RP;RObxhqqCqCrSw_7T zB&=eLoN`V3Zp*Jf2L{?rt0VBCMxX=s*mjc$OO&bF@#*mSm4BBRH9ANvzk`cxJ&XLd zxLj{Ny>1-8x&Cwh(4krQ=+OOiaqE+L`;&0KlMW#aJc>#>F>Ep>Ecq+w1SFKe)tYep z8DZ4kCt-M`I5PxvexAs_9L{OcMh%)U6&j}M>cy&Zh{fOSVX7Cd-phLRfHXozA52d} z-BOz2K^MASM*ehV@mfnuTmq0jS~tA4yh)XAS4kskTdkR&;n9M*5H%3_3Lg>@IXZfR z4U6dl@#7qcXzIR0`s!ykGva3EQE%ilAwMc5^LE#-;E){IodwvecQEYw_CccGaU*WEGG}y zGQzY{*?~tW#2B5*cs!aWfSrWHIDp&)3Ox?K54I2bzMdO*RFAKT#Z>j>eZy)bRD#!E z1*eoH*OJ=f?(ueEdCXyD$DF5~xjBwS*CogMwnEc`83Z8Jz}1``DchM%eHr`_N*+X! zh8u81f-Ja`U~TiER)x2J{82=!6U zfnP`1Fzfg*RDfvEDpouH;jGl@myZ+f3y|&S_h)u5(HR#6^NW2s6gBhMB=dt~O^zPd zAYlIhOU+br#}zsZJ3aOQ8+I;v%R(bzrd21`yay*HQl?i zN``GVYHpy}32!rad*XDsavuSlNEFZ;M6>!Y0n6n|yL>BqTf>n${UzLR?yZa5@YnQoHxG5t|OVHyl! zx&hXbf4gLrH^v7qj3B9f8B9&X z_hlS{;x|?^W+r=Z*#8?$)nQ#{(ZS_u?k6S_{qAN!DtD_e#V{iNeGIyIl(EGN#H{sv zS~QM;O2}5IR;<)%uRoI9ai2P$Nlw`>Mjoo}30oK~7BCDC4ZB-FgBX_xvM>waaCK`K zUyc4Wz*zk?7bXSP8MrsS90I(gcch(9RN{Qy(D2lVOw~Zh3eZs_YXl=S2LIE=y-cPtbs*(!A!ijSVZ?h2 zr^@ZLk~%yM2?HTrQG-uh6_#t|*%d>3nL6C=C+%=Rtt$^1^0c&;_rG>Be_PE(ZrmML zXP`c8}DZpsXI&20LN;D68L+iwAtIIvrG1mi+s4Uh<8qE}(?^vT~ulkfK zO5r|=2B?_3XAouIaK>F?Z3UwXCuAgIV$rSsGd~ObtCq4K86Xws>Qs*Pqx4n1kK@6+ zFE7#-VY}b;q}520j$x9m9};8QV)~*Pp@xFQ%x?q&^%($O#qI+1^BZi}1Vk%F&vc%yYa2Q}ubbA-AnW$%Qj?vJEMdHv61v1^jYCS?q41CPS(XZD;(~w&aI*aE~0^v zx`oCn_b&R_OBnM$Pnf~#`#KFR%VRrjZg{*uy=NNaOX*;?ajWC&*=X5ex)fWWr_ekI z-Xs_^nnXv0avn}7mZ&CtVDD+-cRWp^3+cQ@FfT*kE~HqzSUFiKwcvqS#PQsugUl$02NsI81-x#jmDTTRze4{K^#J#T*X{7^s2CP59;O-FXj96iX6`Oyqh~dJZ-kBh=2z3y7 z4f=(SqaD>($U=2HZ<0-AT>xfk>!p1a?vVa%6VLpN1&Q8*iaOSFzZ@AGGu#mIH6KE% zBBHk;pV+woO&TEHUkB%GwFraAV7yO;UIc(2e%bso)G1}Umw4D0d}uL^^=b~67u>25 z!xDla-+$$P&Ve?|u74%R5_O0ew`oIO!s!coW6)(28GLB~w1?1-P0F^!Z0dY{&C*i^ z*x}WQlgYt?x~gteqX(E!u{bwQD+)Mme00(YQUSN4<@TWE5I23$s<#@5COiQjVexMGwt5W&=I@{fGWIxc0QIp72p`cw|Ql3THA&jCS6o(uJ! zFj6t3h0X9WHk(zT$Boi6E@-qW?uLg-3c(>hDE|7}IQ-XU96k;n59nq++;6?3PlS0Q zW6+lBG>o2OYsFXU2sxat_I~FH*&lge7%whT-wVrIwB2Xu?f@&G$I~sIme;%*b&=Dn zL9Q5A4s~_)AC{IDzDH?Y+xHO>%=Dq|R|1QsdAIyjVM^j1vVsqbmCTj$oXS4_;zik0+Dz{xr( z`i3)oKDITNT6%@tPN%{(Wa&{&+-`ZVkzLw3KYAg@y zK+XT?_*? zSB;)YjEggd%tl^>l6owlmA0IU&sq`vwMY383{(m(PrKHCs??_xaXE#8AR~&B-Rz3B zoAR2Pu2`!r>odKQkojQaee8gNwq`!U#To|VrxgT(reBq0-arhZmsCOHXd!)zU{ zS>ev&XaYui1?UId$8Tvxopi06dzu!T^hsZt@cmOi1qN$Ji;{y+(KC8@!pXq~1h&>8 zNt90JhL7m|4ab6KdwRy<5t0#HC+XBKoxGo%R01QwGT+BhheJm{SZVE6KBDz~RU655 z*?0O^0%%??7!@ET=qu#yH|H>LgEUtn76Q z3e$|w^%K@2pRuCf{JCsW4La}dkZZK(iiNhah|{;gJ@J8`8jBO9+h|`c!`%EC?&Jc1qA3LFQzu#t#;u?%5L=6QutigqP#qx4UnmW~s@D`sUwj^$cmEsl#R*S62VZ;x-OV9Ze%=jI4&bl%zQYWo}9dV^>NG9&cQFm@P>S@ zd6Q3B65WelrSZ}@NQB}(M6#E%?>ajA!7}s?8{6v~UKvogWwz=~1^+lu^*z^jlr&NW zH+#n}x4pXW4K&Clfz|TnUH7@!7US2gOKc-{n0$B!Fv#>eX-pr-<^U@OR3Rg8 z+&oY#|4go?e?w`279_pmF3HEmzWc||f4KO$Vs5iur^SDBt52^gsOxM>Z=z__!|jDE z(-VyAIBmqWDc_{PgziR7UvtvOcRV#VrW{w%XFsRHh1Iwv?q0N{r1R{0DQAB4uL(#s z$y*scReuS$qW-R)DL9#9ctkNlSjsBsqlxpDtfxX6jR?XV>j|k8jocha>W~t&KC7M?v88q{B zY?Ei$Hc|zN31F3)6m^$FB!6!^;_m?Y`%4F%gh(!e?rMXme4O1E>Wt)~`te3;dPlCq zJbAL8r$pIQCVp)&WagHII;_0Pc^#Ombq|)5fL`W?&{@E?E&qIdNom2t$oSpQmY(d@ zt5=^tv?xbgf~rtoH0$lK5KXb~yUz4DcOi8QLVE`s!mieNXW>WXRDCQA1X$?N>Hs;G z*oJGZxG)pV3CiwYXX-@q)KZ!+V+D=;!G5Pw3Ih!xxP_C5r8witJr3A-NJe5$Af%&q zlnhyc-gjQPIxP97^Getri!Jm$&<;(J}N|lo`4dEcIjK_D810z)C@PAJ2R`z7F!&Ad_%FM z73~W%TpG!yG1>%&hwP>#g_1c+Vi_E|=afWHwM9!6IxIDUmmOy*->YftBN6+}TEq3N zVtUgD-%e%tiRH^#bH}-@{_mgItF#{WNU%gqfcU92P)03tHHK{dys?IkxH?~_Ju@Rn z&haZcv*y`Zs>fql*h6MoN}RsRo`LIk~|Spycw*es>v15V9#M6r zR>4vo676tAr@kx%;6mGgPDI0^5*sCI!fu7Ip2N`F68u z@l0R9~Pjo`yd;Kyq%r78)-$$Ee?x8 z`36jw8(VKo_zPFln8yy6vorSi#c&VPN$6?$r~C(rKb*aGoc>QOK1Z+S_Aah$a;S3Lw* zk+HeuItmx>kb>Za5L~B-W|DV1DQ>HnF-Is^ zn_z8%@v`%%)Pzb<#*JQ6?U9HS{heLhSPHN9G5!)!?g>*f@;dSd80tMQXJcnRTak|> zmuCC=&lUaWL-f6uhv4?s1NS^QJ*dFR^q;TWA&TH5VEew^u{f*0$C1i(bUjK%O?_)9 z!Mnl^_4}=|U1Tqjf4tQe^1?T)TtkR4F`SA}@Pmx_(LNCo9g@Sn*#lWtL41VN1~g0Vpv`HLU%mT@lyNId`ws#P2|G6p$DRm%2ZFj)2{Dxi@3 zPG2t~Amwc)(i##vcZ}mW&Q;NdGO(9lHstwBjMR?DL}n(u2GKe~5nCX_oq~?mXH+7D}7?1Xmk~@>3=`H$VfN-%ued;)t%{L zxpAMyBcyq`10H7ddO-XcL|_Q6iH0wJ%uHP~&JUO{GFy;dooo*}97R!kx~G$t3k!sr z6-)Vk%98*V@BNdL6Uxa%?)Z43zTCf8Maxtto4?Fol=U!VO{0Y>6-o*<2B zj=GQlt8|bWAO}x8JaN`nO9%}b-N^q8Ree*OBUm8CZ_{~DeE)r_St;nGT9|mkA*g=s zvN`FDX^mvyR`R^J;&m$dySLI~Iwer9aY|swvuZ=66yTpiUjbl^%h?-CQ&8c&t*OfN zpWXk*%m*QNm!t9nV40Xo0XGeaT33s{fQI|sBj^vE0vNiKwGSTYH#~VW9IlgfGWT_6 znq2VcL{m=5wu`fV`74chXix*j#F<Gy_7>vz9D$u~E!yt-aziv*RN-?i!muG^F6w6G&NbRy7ub$yZPIk&rAKNG7+@+4t|_g+OvX?)mD2oo#TJOufy&-o2x7Q^jS^< zFxB%PEb?GsasR}gwUxlZB-f>YQC;-bl*)sl4E)vdu~%iYzh149as(Lc#GF?J7@>v2 zHi<)G096?zC2gJ;B?||E!$S>N>pJd8W<2SmJ#e@~0NGHF+)NHk&bWSl3xYdQ`R2<|-lo_s%yPu&tV# zKUf6jYCu+9wT)Q%mhe_jB^m@H^?i_s|39yqbq%_Vi|BMY{|nrC3H6Up?Kx=-m_ea)K7sK!7$0+kQkwg0)g9f@|wc(|#O1njX|sjXjK?yT1O_OqA? zQ!id(Ic<{S73VlXv+$sLqCTx|it#ZdSno1FZyd<_9j!^#_w|Ilx41js`^&<~Il(=2 z^(FdqF5yEOrXed%s>8QZYJ3*`G~hYl$DcACc{fIK@@I6!lB{Qwlg2cWR_Y1@$j{=* zsf#E*tVh^195rjnh7{&ybLUx%R8K0r_)AGWMMtKt>AeiyWUv&itcS_I;o;?cZ66X; zAHtBiVIB6q|0a?DWag|g$x#hPKzT2nP3Z~EW{U)qd`Pj0N0d_L$+x^4uY0&jl{1Q6 zx$ZfAxLqG~n%Lj9!efTOI1Sww?Ct$emXN|2C_*(T&kTm0dmwYZTM}OhMplb>wbBDF zXs-7-5?^_Ec+g{E0^E357($DTxnNJ3n30!D z3QKv4du1;a0vhMZcy=6GU82e#yx@PZwlu$3on5T7uRp4Rdnf&1e= z`b{GO56H6>=gpn^jYNP-bNcr>eHLIakw!eZw(W|DPak#nKZwR4IQVDDrwC)fPJnKnkM?fT75^<^Wf1pr&y2=Hm$opEl+@=yEn(gRa+1M09GGh2m)W@Jy zGRgcW-`M#1J*p}%VA1h^!ftBcdrj{s5rq#}hF->A^+7Q-*lS1NXEIQ1N zn3xKh(#&)cU)b4^pA?4OZnHt`bo@7KgH=O@#@f-Jm?2O-=(8+5>T&-^z#Vg)bR0AD zV0|bZgNmEoiv`P0F^Vz19=emnW`i&KY5$Y#M`sMke2(??F-^}d*#I}7s2gN~r{jk}cF#NR)G zDrFEN%cDU%wTU8jgLd}az$=kN2XRkC(#0o1ltBD0tr4G+Ex6xAJ zEheTwST=i^#5ZmDp?Jy)9;+&5e$qyej z*Y{T3ylHVNnP6-QWmSAm1gLeTFX{Reb+WiqCA8XDSy+belhJP=)x7U`dF$xzo&!A7 zW`b-;vY3Zp-`Bqd4gd}JhZ@A=NaNd#q~>E^}Vn&+V;Z^pw%jE8Q z)0yEnb(Rfs`Mf}m8~CFSym9hf8f@vbO;sG!9M~k1Jt-<>Ac!Yc!ulGyltRfEWCr3b z$uXrm1SP(L;*OZPC_OuN!ACH@xf<$#%pVSla&t7YK^L3DV~WGH*>8TIuBz_kL)NYXUHPyw?ia30LS9*W zE28@OhS=al53}{@XmZ!AYklQ*)UIk2`TO`GA#?^fY^CL>HMbq>73A;PKc0&fne8Ei zCQA8?WJYG*!6-`|A0Iu0MZ)a`!Lp?|1|6p)NE=>lyrW|JnnI-u1@z_@a(%br#BDSI zy_vXis8+j9MLtD0v3z#8m1HQ{rlrc-@I(Iw^lZOZ#rc1nv4{R04+ zI432sD915e@!tJhe&g&l100P5#>s)_zI z%n^SZY%iVj`@5w4?wlI{pUdcW`PgYau9uT8=oJYxH7nIIsB99LG|vSBDKoj;bVUKn zsxR==Lw9+!Abi0CndX`&NQe6K_!;9|n!3~Nf6dX;dK!vc!v`;JBVv^e;u$n2n?(>7 zB`838>kVIuyY9;Q;JQ?IG}~%_6_%m+S>1$g%gM*5s$7SRj10}%aT~)dezFEz&65u( zIV~i)TTBB!ER}$e2c`k}&FrT%$@rsW;e-t6sgGuABRaTjGJ_?PhFzQDEf$Ub)A{d} zYulmglOVVj+b{678ceu*I5P8otQ--mxXG}xViv?EYDxvkMa~EW}O z-Ye+5gg#)|9MNfrf7jG+<8Dh0r_yqZ#DWY7rVPCX?oTIQe#zK_w{=jkUN))HihRhC zeaD$#h;a*LD4Eru5SP+aCOFCqa2wHM$n-fT;h>tqBwz>HV98BwHJ6{_EP&Z6vF-D0 zfJ9?_l@FDY?0990@w^Oo1~ zYyw~p&LjQ9Upr^&&%liQP-bJ}<|9-1|Bu`lbpC+{kzHHHK7&RqlNMx!e>do_(F6ik zqyA;O#>Nu|YlU&zZ@*fF?5^b(VBvN`WN@o~yA1!)FQC@XtJN8)xlIp1J>L9%*sQdw zml^i$@Oh+A(3yW9gyZGsgWrW)=W28F(nzym8|YD;_2r<&Z+$CL!ECSd#t{V@bli`X zprEFPIs2<%xIy#mY%__Pwg!5|TVnZ#9!mCzX)40KaQ;m3eNLB<1SEx7VGu1koixrr zI?tx0tm6XMlS}e93(q`zu>^L#b^4z?^)K`B_4OY9LH)6z>sWqfmlC!3h}(hSp#uNp zS==Y@I>g$7YenaQpZH;M(o>xf2xgqt%$$Qjq`D+W4{uY1&EKQjEZvH8EKE10j7mRd zLzdS})gGQClK9&&%}1+RWquO@iluM8h7}bWW0KioAQ*O$<;bz5%o(>~GCl5IxPXz?WenkK1k+ns)6Ru4IpPC@VJ~bU; zqV{jg`L#+4Ldo^cq6BK|Bi@8h-P{-3eRrH0^jr0}K_V__+2l!vvjT1hi$YWJ5@zPf zQ&mn@P7MJ>jgb)Y0nRs!xMq5oy8bGQ^x?u%ekq+-6d%z8zOud$bwpZ4i3Ex|Nc)q* z$W{1HxkLnIudxfcCIa5+mRq-W5m$!6p{s(<{Y{k~z(St^wGMt>hKtFD*DTTNvQdvw zFe^^EP5D+xHZyui>6oN4{6?Iku_zhyYjdkfOdoBuxe6`~9&&pQ0bFEKw zWxls(>wU9mw70a*0dQ0NoM8|2gvrP=L(Rt-zmf_KrCf5q{Mebcnl$_$Ru*1P+#K1W zG^I3qRq`O8Cnjrmhd68j-8RIc74G-;md41eEK6mryc)tgm+fFhCvI<=d~0G?behYm zZT#>kzPmJ~bH6BCQ2n;oUm|C>C$M&A%)`nq(4#G;vzHB+(-6%eVt+aU#emxsBgzVk zVn>6%Iw$sU@vt4}3;vl5n*8f*cB3RfT>D8MJLfNA-fuZXxJB%_>FLOgJDmd8P1nw3bcx1UP@}2@HJC%mfGYUvV^p@T_;c7mg;PJ@NmCG#33naRk^j!RLx|6Zd8Kbp`AEG$h!AxrOmT zYw84F6Pbm4t6p2E-0U}Y)^|cSOLRDvtrHNOaQ|3>@Kija(7%{FUOx`Nh3auX#S0ix ziq55K`0;(B>2mm(WBM6Yn8ibJaY)RB%d0%Ju=h9>|2xeJWh-LDa$|KQ@rwOcMn-BtAVR(i9B?w?rMDJdU<)9T6U1ezk z-jFfs>!U5d^uP2#&gPJ}n_{h02}9o3gk}!83zhyClT9`U$3-N0JA3Lm^qps6I@ETm zYRDjYXmgdUxV)L(+4`#CDnbbHoH4OlD(Id-5x!QONyL8>ns~oi&qr>4@2^J;6zMYV z4wcI?7m&?#lBADeDWT7TKJoabf(Sq91suxiw%yAZ8%yuDsxZt8sLH1nee#zr^jx(=m z%RI`fGSgFlEHTH)15((7-^mAWiPk)WLm_ZQbMgwqC^=5aEA6$($SUG&zugbjdBT%f&!<6Q%H zH=EXy+~raUgKOqLtdUgc_lq|!Me^TOL!hkP2lsIfB%&=rS<@XBAHol3oR`P1ByYzm zfOF8;6}|181f-FK?KMN?35QFk^?J%uHEbQ@K5RXd1*7dpFp7TdBISf*Q4`0=95TkJ z*{c-x^8MQ+xA|-mWNW$~oxx3=!D3$=$@i8o@J_~+7d$=^=~h;YktmW*-ra4h08(RJ z&fu_!a`&eoY20ip&7;Pr#0N**q%EE$vHS5Rrr%Id3D(L$(y(h6ndRe}@)!FmL0tL* zRF{h)9Qwpv3v388v<;+1ME-#>A29!#-(zocd{2xo&tj((gMkxou3NHLH!ftsS=Zvw zZF0=H;TVhA_$8_@bz_t8XIe^GN99G8`tQxn0iilC`fiTgk1dw>(Tzk+6;x**@WL$p zQJ@=Io%eHxSx1DhthDCrfpm^5Ja3haq|<#f{IXm<%dj4_J?&WHw){wa+M=mloIHlN ztJx)x3A(Ib!*TWs#~{7RLth zSAATi59wgv`5q({ru)W61?xhx){GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ diff --git a/samples/client/petstore/python-legacy/tests/__init__.py b/samples/client/petstore/python-legacy/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-legacy/tests/test_api_client.py b/samples/client/petstore/python-legacy/tests/test_api_client.py deleted file mode 100644 index 9baa62120e16..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_api_client.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - -import os -import time -import atexit -import weakref -import unittest -from dateutil.parser import parse - -import petstore_api -import petstore_api.configuration - -HOST = 'http://petstore.swagger.io/v2' - - -class ApiClientTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - - def test_configuration(self): - config = petstore_api.Configuration() - - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = 'PREFIX' - config.username = 'test_username' - config.password = 'test_password' - - header_params = {'test1': 'value1'} - query_params = {'test2': 'value2'} - auth_settings = ['api_key', 'unknown'] - - client = petstore_api.ApiClient(config) - - # test prefix - self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) - - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) - - # test api key auth - self.assertEqual(header_params['test1'], 'value1') - self.assertEqual(header_params['api_key'], 'PREFIX 123456') - self.assertEqual(query_params['test2'], 'value2') - - # test basic auth - self.assertEqual('test_username', client.configuration.username) - self.assertEqual('test_password', client.configuration.password) - - def test_select_header_accept(self): - accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/json', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/xml', 'application/json'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['text/plain', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'text/plain, application/xml') - - accepts = [] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, None) - - def test_select_header_content_type(self): - content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/json', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/xml', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['text/plain', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'text/plain') - - content_types = [] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, None) - - content_types = ['application/json-patch+json', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types, - 'PATCH', [{ "op": "add", "path": "/myPath", "value": ["myValue"]}]) - self.assertEqual(content_type, 'application/json-patch+json') - - content_types = ['application/json-patch+json', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types, - 'PATCH', {"value": ["myValue"]}) - self.assertEqual(content_type, 'application/json') - - def test_sanitize_for_serialization(self): - # None - data = None - result = self.api_client.sanitize_for_serialization(None) - self.assertEqual(result, data) - - # str - data = "test string" - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # int - data = 1 - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # bool - data = True - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # date - data = parse("1997-07-16").date() # date - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16") - - # datetime - data = parse("1997-07-16T19:20:30.45+01:00") # datetime - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") - - # list - data = [1] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # dict - data = {"test key": "test value"} - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # model - pet_dict = {"id": 1, "name": "monkey", - "category": {"id": 1, "name": "test category"}, - "tags": [{"id": 1, "name": "test tag1"}, - {"id": 2, "name": "test tag2"}], - "status": "available", - "photoUrls": ["http://foo.bar.com/3", - "http://foo.bar.com/4"]} - pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) - pet.id = pet_dict["id"] - cate = petstore_api.Category() - cate.id = pet_dict["category"]["id"] - cate.name = pet_dict["category"]["name"] - pet.category = cate - tag1 = petstore_api.Tag() - tag1.id = pet_dict["tags"][0]["id"] - tag1.name = pet_dict["tags"][0]["name"] - tag2 = petstore_api.Tag() - tag2.id = pet_dict["tags"][1]["id"] - tag2.name = pet_dict["tags"][1]["name"] - pet.tags = [tag1, tag2] - pet.status = pet_dict["status"] - - data = pet - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, pet_dict) - - # list of models - list_of_pet_dict = [pet_dict] - data = [pet] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, list_of_pet_dict) - - def test_context_manager_closes_threadpool(self): - with petstore_api.ApiClient() as client: - self.assertIsNotNone(client.pool) - pool_ref = weakref.ref(client._pool) - self.assertIsNotNone(pool_ref()) - self.assertIsNone(pool_ref()) - - def test_atexit_closes_threadpool(self): - client = petstore_api.ApiClient() - self.assertIsNotNone(client.pool) - self.assertIsNotNone(client._pool) - atexit._run_exitfuncs() - self.assertIsNone(client._pool) diff --git a/samples/client/petstore/python-legacy/tests/test_api_exception.py b/samples/client/petstore/python-legacy/tests/test_api_exception.py deleted file mode 100644 index b076628c0a0b..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_api_exception.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import six -import sys -import unittest - -import petstore_api -from petstore_api.rest import ApiException - -from .util import id_gen - -class ApiExceptionTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.pet_api = petstore_api.PetApi(self.api_client) - self.setUpModels() - - def setUpModels(self): - self.category = petstore_api.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = petstore_api.Tag() - self.tag.id = id_gen() - self.tag.name = "blank" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def test_404_error(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id) - - with self.checkRaiseRegex(ApiException, "Pet not found"): - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - except ApiException as e: - self.assertEqual(e.status, 404) - self.assertEqual(e.reason, "Not Found") - self.checkRegex(e.body, "Pet not found") - - def test_500_error(self): - self.pet_api.add_pet(self.pet) - - with self.checkRaiseRegex(ApiException, "Internal Server Error"): - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special", - file=None - ) - - try: - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special", - file=None - ) - except ApiException as e: - self.assertEqual(e.status, 500) - self.assertEqual(e.reason, "Internal Server Error") - self.checkRegex(e.body, "Error 500 Internal Server Error") - - def checkRaiseRegex(self, expected_exception, expected_regex): - if sys.version_info < (3, 0): - return self.assertRaisesRegexp(expected_exception, expected_regex) - - return self.assertRaisesRegex(expected_exception, expected_regex) - - def checkRegex(self, text, expected_regex): - if sys.version_info < (3, 0): - return self.assertRegexpMatches(text, expected_regex) - - return self.assertRegex(text, expected_regex) diff --git a/samples/client/petstore/python-legacy/tests/test_configuration.py b/samples/client/petstore/python-legacy/tests/test_configuration.py deleted file mode 100644 index d86666e4205a..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_configuration.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" -from __future__ import absolute_import - -import unittest - -import petstore_api - - -class TestConfiguration(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - # reset Configuration - petstore_api.Configuration.set_default(None) - - def testConfiguration(self): - # check that different instances use different dictionaries - c1 = petstore_api.Configuration() - c2 = petstore_api.Configuration() - self.assertNotEqual(id(c1.api_key), id(c2.api_key)) - self.assertNotEqual(id(c1.api_key_prefix), id(c2.api_key_prefix)) - - def testDefaultConfiguration(self): - - # prepare default configuration - c1 = petstore_api.Configuration(host="example.com") - c1.debug = True - petstore_api.Configuration.set_default(c1) - - # get default configuration - c2 = petstore_api.Configuration.get_default_copy() - self.assertEqual(c2.host, "example.com") - self.assertTrue(c2.debug) - - self.assertNotEqual(id(c1.api_key), id(c2.api_key)) - self.assertNotEqual(id(c1.api_key_prefix), id(c2.api_key_prefix)) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/tests/test_deserialization.py b/samples/client/petstore/python-legacy/tests/test_deserialization.py deleted file mode 100644 index 3192b944d920..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_deserialization.py +++ /dev/null @@ -1,241 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import os -import time -import unittest -import datetime - -import petstore_api - - -MockResponse = namedtuple('MockResponse', 'data') - - -class DeserializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.deserialize = self.api_client.deserialize - - def test_enum_test(self): - """ deserialize dict(str, Enum_Test) """ - data = { - 'enum_test': { - "enum_string": "UPPER", - "enum_string_required": "lower", - "enum_integer": 1, - "enum_number": 1.1, - "outerEnum": "placed" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, 'dict[str, EnumTest]') - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest)) - self.assertEqual(deserialized['enum_test'], - petstore_api.EnumTest(enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - outer_enum=petstore_api.OuterEnum.PLACED)) - - def test_deserialize_dict_str_pet(self): - """ deserialize dict(str, Pet) """ - data = { - 'pet': { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "name": "string" - } - ], - "status": "available" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, 'dict[str, Pet]') - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) - - def test_deserialize_dict_str_dog(self): - """ deserialize dict(str, Dog), use discriminator""" - data = { - 'dog': { - "id": 0, - "className": "Dog", - "color": "white", - "bread": "Jack Russel Terrier" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, 'dict[str, Animal]') - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog)) - - def test_deserialize_dict_str_int(self): - """ deserialize dict(str, int) """ - data = { - 'integer': 1 - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, 'dict[str, int]') - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['integer'], int)) - - def test_deserialize_str(self): - """ deserialize str """ - data = "test str" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "str") - self.assertTrue(isinstance(deserialized, str)) - - def test_deserialize_date(self): - """ deserialize date """ - data = "1997-07-16" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "date") - self.assertTrue(isinstance(deserialized, datetime.date)) - - def test_deserialize_datetime(self): - """ deserialize datetime """ - data = "1997-07-16T19:20:30.45+01:00" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "datetime") - self.assertTrue(isinstance(deserialized, datetime.datetime)) - - def test_deserialize_pet(self): - """ deserialize pet """ - data = { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "name": "string" - } - ], - "status": "available" - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "Pet") - self.assertTrue(isinstance(deserialized, petstore_api.Pet)) - self.assertEqual(deserialized.id, 0) - self.assertEqual(deserialized.name, "doggie") - self.assertTrue(isinstance(deserialized.category, petstore_api.Category)) - self.assertEqual(deserialized.category.name, "string") - self.assertTrue(isinstance(deserialized.tags, list)) - self.assertEqual(deserialized.tags[0].name, "string") - - def test_deserialize_list_of_pet(self): - """ deserialize list[Pet] """ - data = [ - { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie0", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "name": "string" - } - ], - "status": "available" - }, - { - "id": 1, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie1", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "name": "string" - } - ], - "status": "available" - }] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "list[Pet]") - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) - self.assertEqual(deserialized[0].id, 0) - self.assertEqual(deserialized[1].id, 1) - self.assertEqual(deserialized[0].name, "doggie0") - self.assertEqual(deserialized[1].name, "doggie1") - - def test_deserialize_nested_dict(self): - """ deserialize dict(str, dict(str, int)) """ - data = { - "foo": { - "bar": 1 - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "dict[str, dict[str, int]]") - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized["foo"], dict)) - self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) - - def test_deserialize_nested_list(self): - """ deserialize list[list[str]] """ - data = [["foo"]] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, "list[list[str]]") - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], list)) - self.assertTrue(isinstance(deserialized[0][0], str)) - - def test_deserialize_none(self): - """ deserialize None """ - response = MockResponse(data=json.dumps(None)) - - deserialized = self.deserialize(response, "datetime") - self.assertIsNone(deserialized) diff --git a/samples/client/petstore/python-legacy/tests/test_enum_arrays.py b/samples/client/petstore/python-legacy/tests/test_enum_arrays.py deleted file mode 100644 index 2f7e347f9c35..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_enum_arrays.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class EnumArraysTests(unittest.TestCase): - - def test_enumarrays_init(self): - # - # Check various combinations of valid values. - # - fish_or_crab = petstore_api.EnumArrays(just_symbol=">=") - self.assertEqual(fish_or_crab.just_symbol, ">=") - self.assertEqual(fish_or_crab.array_enum, None) - - fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = petstore_api.EnumArrays(just_symbol=">=", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, ">=") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = petstore_api.EnumArrays("$", ["crab"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - - # - # Check if setting invalid values fails - # - try: - fish_or_crab = petstore_api.EnumArrays(just_symbol="<=") - self.assertTrue(0) - except ValueError: - self.assertTrue(1) - - try: - fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["dog"]) - self.assertTrue(0) - except ValueError: - self.assertTrue(1) - - try: - fish_or_crab = petstore_api.EnumArrays(just_symbol=["$"], array_enum=["dog"]) - self.assertTrue(0) - except ValueError: - self.assertTrue(1) - - - def test_enumarrays_setter(self): - - # - # Check various combinations of valid values - # - fish_or_crab = petstore_api.EnumArrays() - - fish_or_crab.just_symbol = ">=" - self.assertEqual(fish_or_crab.just_symbol, ">=") - - fish_or_crab.just_symbol = "$" - self.assertEqual(fish_or_crab.just_symbol, "$") - - fish_or_crab.array_enum = [] - self.assertEqual(fish_or_crab.array_enum, []) - - fish_or_crab.array_enum = ["fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab.array_enum = ["fish", "fish", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) - - fish_or_crab.array_enum = ["crab"] - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - fish_or_crab.array_enum = ["crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) - - fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) - - # - # Check if setting invalid values fails - # - fish_or_crab = petstore_api.EnumArrays() - try: - fish_or_crab.just_symbol = "!=" - except ValueError: - self.assertEqual(fish_or_crab.just_symbol, None) - - try: - fish_or_crab.just_symbol = ["fish"] - except ValueError: - self.assertEqual(fish_or_crab.just_symbol, None) - - try: - fish_or_crab.array_enum = ["cat"] - except ValueError: - self.assertEqual(fish_or_crab.array_enum, None) - - try: - fish_or_crab.array_enum = ["fish", "crab", "dog"] - except ValueError: - self.assertEqual(fish_or_crab.array_enum, None) - - try: - fish_or_crab.array_enum = "fish" - except ValueError: - self.assertEqual(fish_or_crab.array_enum, None) - - - def test_todict(self): - # - # Check if dictionary serialization works - # - dollar_fish_crab_dict = { - 'just_symbol': "$", - 'array_enum': ["fish", "crab"] - } - - dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) - - self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) - - # - # Sanity check for different arrays - # - dollar_crab_fish_dict = { - 'just_symbol': "$", - 'array_enum': ["crab", "fish"] - } - - dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) - - self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) - - - def test_equals(self): - # - # Check if object comparison works - # - fish1 = petstore_api.EnumArrays("$", ["fish"]) - fish2 = petstore_api.EnumArrays("$", ["fish"]) - self.assertEqual(fish1, fish2) - - fish = petstore_api.EnumArrays("$", ["fish"]) - crab = petstore_api.EnumArrays("$", ["crab"]) - self.assertNotEqual(fish, crab) - - dollar = petstore_api.EnumArrays("$") - greater = petstore_api.EnumArrays(">=") - self.assertNotEqual(dollar, greater) \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/tests/test_map_test.py b/samples/client/petstore/python-legacy/tests/test_map_test.py deleted file mode 100644 index 6031cebf3a2b..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_map_test.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class MapTestTests(unittest.TestCase): - - def test_maptest_init(self): - # - # Test MapTest construction with valid values - # - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict) - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - map_of_map_of_strings = { - 'val1': 1, - 'valText': "Text", - 'valueDict': up_or_low_dict - } - map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings) - - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - - # - # Make sure that the init fails for invalid enum values - # - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - try: - map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict) - self.assertTrue(0) - except ValueError: - self.assertTrue(1) - - def test_maptest_setter(self): - # - # Check with some valid values - # - map_enum_test = petstore_api.MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test.map_of_enum_string = up_or_low_dict - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - # - # Check if the setter fails for invalid enum values - # - map_enum_test = petstore_api.MapTest() - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - try: - map_enum_test.map_of_enum_string = black_or_white_dict - except ValueError: - self.assertEqual(map_enum_test.map_of_enum_string, None) - - def test_todict(self): - # - # Check dictionary serialization - # - map_enum_test = petstore_api.MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_of_map_of_strings = { - 'val1': 1, - 'valText': "Text", - 'valueDict': up_or_low_dict - } - indirect_map = { - 'option1': True - } - direct_map = { - 'option2': False - } - map_enum_test.map_of_enum_string = up_or_low_dict - map_enum_test.map_map_of_string = map_of_map_of_strings - map_enum_test.indirect_map = indirect_map - map_enum_test.direct_map = direct_map - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - self.assertEqual(map_enum_test.indirect_map, indirect_map) - self.assertEqual(map_enum_test.direct_map, direct_map) - - expected_dict = { - 'map_of_enum_string': up_or_low_dict, - 'map_map_of_string': map_of_map_of_strings, - 'indirect_map': indirect_map, - 'direct_map': direct_map - } - - self.assertEqual(map_enum_test.to_dict(), expected_dict) diff --git a/samples/client/petstore/python-legacy/tests/test_order_model.py b/samples/client/petstore/python-legacy/tests/test_order_model.py deleted file mode 100644 index 31dc6e3661cd..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_order_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class OrderModelTests(unittest.TestCase): - - def test_status(self): - order = petstore_api.Order() - order.status = "placed" - self.assertEqual("placed", order.status) - - with self.assertRaises(ValueError): - order.status = "invalid" diff --git a/samples/client/petstore/python-legacy/tests/test_pet_api.py b/samples/client/petstore/python-legacy/tests/test_pet_api.py deleted file mode 100644 index 3dc3669d27c3..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_pet_api.py +++ /dev/null @@ -1,325 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import unittest - -try: - from unittest.mock import patch -except ImportError: - # Python 2.7 - from mock import patch - -import petstore_api -from petstore_api import Configuration -from petstore_api.rest import ApiException - -from .util import id_gen - -import json - -import urllib3 - -HOST = 'http://petstore.swagger.io/v2' - - -class TimeoutWithEqual(urllib3.Timeout): - def __init__(self, *arg, **kwargs): - super(TimeoutWithEqual, self).__init__(*arg, **kwargs) - - def __eq__(self, other): - return self._read == other._read and self._connect == other._connect and self.total == other.total - - -class MockPoolManager(object): - def __init__(self, tc): - self._tc = tc - self._reqs = [] - - def expect_request(self, *args, **kwargs): - self._reqs.append((args, kwargs)) - - def request(self, *args, **kwargs): - self._tc.assertTrue(len(self._reqs) > 0) - r = self._reqs.pop(0) - self._tc.maxDiff = None - self._tc.assertEqual(r[0], args) - self._tc.assertEqual(r[1], kwargs) - return urllib3.HTTPResponse(status=200, body=b'test') - - -class PetApiTests(unittest.TestCase): - - def setUp(self): - config = Configuration() - config.host = HOST - config.access_token = 'ACCESS_TOKEN' - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) - self.setUpModels() - self.setUpFiles() - - def setUpModels(self): - self.category = petstore_api.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = petstore_api.Tag() - self.tag.id = id_gen() - self.tag.name = "python-pet-tag" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def setUpFiles(self): - self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") - self.test_file_dir = os.path.realpath(self.test_file_dir) - self.foo = os.path.join(self.test_file_dir, "foo.png") - - def test_preload_content_flag(self): - self.pet_api.add_pet(self.pet) - - resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) - - # return response should at least have read and close methods. - self.assertTrue(hasattr(resp, 'read')) - self.assertTrue(hasattr(resp, 'close')) - - # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. - self.assertTrue(hasattr(resp, 'release_conn')) - - # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking - # change, however supporting above methods should be enough for most usecases. Remove this test case if - # we followed the breaking change procedure for python client (e.g. increasing major version). - self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') - - resp.close() - resp.release_conn() - - def test_timeout(self): - mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - - self.pet_api.add_pet(self.pet, _request_timeout=5) - self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) - - def test_auth_settings(self): - mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Prefix ANOTHER_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - self.pet_api.add_pet(self.pet, _request_auth=None) - self.pet_api.add_pet(self.pet, _request_auth={ - 'in': 'header', - 'key': 'Authorization', - 'value': 'Prefix ANOTHER_TOKEN' - }) - - def test_separate_default_client_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client, pet_api2.api_client) - - pet_api.api_client.user_agent = 'api client 3' - pet_api2.api_client.user_agent = 'api client 4' - - self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) - - def test_separate_default_config_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) - - pet_api.api_client.configuration.host = 'somehost' - pet_api2.api_client.configuration.host = 'someotherhost' - self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - - def test_async_request(self): - thread = self.pet_api.add_pet(self.pet, async_req=True) - response = thread.get() - self.assertIsNone(response) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - result = thread.get() - self.assertIsInstance(result, petstore_api.Pet) - - def test_async_with_result(self): - self.pet_api.add_pet(self.pet, async_req=False) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - - response = thread.get() - response2 = thread2.get() - - self.assertEqual(response.id, self.pet.id) - self.assertIsNotNone(response2.id, self.pet.id) - - def test_async_with_http_info(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async_req=True) - data, status, headers = thread.get() - - self.assertIsInstance(data, petstore_api.Pet) - self.assertEqual(status, 200) - - def test_async_exception(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True) - - exception = None - try: - thread.get() - except ApiException as e: - exception = e - - self.assertIsInstance(exception, ApiException) - self.assertEqual(exception.status, 404) - - def test_add_pet_and_get_pet_by_id(self): - self.pet_api.add_pet(self.pet) - - import datetime - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id, date_time_text_xyz=datetime.datetime(2010, 12, 25, 0, 0)) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertIsNotNone(fetched.category) - self.assertEqual(self.pet.category.name, fetched.category.name) - - def test_add_pet_and_get_pet_by_id_with_http_info(self): - self.pet_api.add_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched[0].id) - self.assertIsNotNone(fetched[0].category) - self.assertEqual(self.pet.category.name, fetched[0].category.name) - - def test_update_pet(self): - self.pet.name = "hello kity with updated" - self.pet_api.update_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(self.pet.name, fetched.name) - self.assertIsNotNone(fetched.category) - self.assertEqual(fetched.category.name, self.pet.category.name) - - def test_find_pets_by_status(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) - ) - - def test_find_pets_by_tags(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) - ) - - def test_update_pet_with_form(self): - self.pet_api.add_pet(self.pet) - - name = "hello kity with form updated" - status = "pending" - self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(name, fetched.name) - self.assertEqual(status, fetched.status) - - def test_upload_file(self): - # upload file with form parameter - try: - additional_metadata = "special" - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata=additional_metadata, - file=self.foo - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - # upload only file - try: - self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - def test_delete_pet(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - raise Exception("expected an error") - except ApiException as e: - self.assertEqual(404, e.status) - - @patch.object(petstore_api.ApiClient, 'call_api') - @patch.object(petstore_api.ApiClient, 'select_header_content_type') - def test_call_select_header_content_type(self, mock_select_ct, mock_call_api): - mock_select_ct.return_value = 'application/json' - self.pet_api.add_pet({'id': 1000, 'name': 'my pet'}) - mock_select_ct.assert_called_once_with( - ['application/json', 'application/xml'], - 'POST', - {'id': 1000, 'name': 'my pet'}) - mock_call_api.assert_called_once() - self.assertEqual(mock_call_api.mock_calls[0][1][4], - {'Content-Type': 'application/json'}) - - @patch.object(petstore_api.ApiClient, 'call_api') - def test_call_with_forced_content_type(self, mock_call_api): - mock_call_api.return_value = 'application/xml' - self.pet_api.add_pet('', _content_type='application/xml') - mock_call_api.assert_called_once() - self.assertEqual(mock_call_api.mock_calls[0][1][4], - {'Content-Type': 'application/xml'}) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-legacy/tests/test_pet_model.py b/samples/client/petstore/python-legacy/tests/test_pet_model.py deleted file mode 100644 index 70ab1a007a06..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_pet_model.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class PetModelTests(unittest.TestCase): - - def setUp(self): - self.pet = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet.id = 1 - self.pet.status = "available" - cate = petstore_api.Category() - cate.id = 1 - cate.name = "dog" - self.pet.category = cate - tag = petstore_api.Tag() - tag.id = 1 - self.pet.tags = [tag] - - def test_to_str(self): - data = ("{'category': {'id': 1, 'name': 'dog'},\n" - " 'id': 1,\n" - " 'name': 'test name',\n" - " 'photo_urls': ['string'],\n" - " 'status': 'available',\n" - " 'tags': [{'id': 1, 'name': None}]}") - self.assertEqual(data, self.pet.to_str()) - - def test_equal(self): - self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet1.id = 1 - self.pet1.status = "available" - cate1 = petstore_api.Category() - cate1.id = 1 - cate1.name = "dog" - self.pet.category = cate1 - tag1 = petstore_api.Tag() - tag1.id = 1 - self.pet1.tags = [tag1] - - self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet2.id = 1 - self.pet2.status = "available" - cate2 = petstore_api.Category() - cate2.id = 1 - cate2.name = "dog" - self.pet.category = cate2 - tag2 = petstore_api.Tag() - tag2.id = 1 - self.pet2.tags = [tag2] - - self.assertTrue(self.pet1 == self.pet2) - - # reset pet1 tags to empty array so that object comparison returns false - self.pet1.tags = [] - self.assertFalse(self.pet1 == self.pet2) diff --git a/samples/client/petstore/python-legacy/tests/test_store_api.py b/samples/client/petstore/python-legacy/tests/test_store_api.py deleted file mode 100644 index 1817477aba69..000000000000 --- a/samples/client/petstore/python-legacy/tests/test_store_api.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAP/Petstore-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api -from petstore_api.rest import ApiException - - -class StoreApiTests(unittest.TestCase): - - def setUp(self): - self.store_api = petstore_api.StoreApi() - - def tearDown(self): - # sleep 1 sec between two every 2 tests - time.sleep(1) - - def test_get_inventory(self): - data = self.store_api.get_inventory() - self.assertIsNotNone(data) - self.assertTrue(isinstance(data, dict)) diff --git a/samples/client/petstore/python-legacy/tests/util.py b/samples/client/petstore/python-legacy/tests/util.py deleted file mode 100644 index 113d7dcc5478..000000000000 --- a/samples/client/petstore/python-legacy/tests/util.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) diff --git a/samples/client/petstore/python-legacy/tox.ini b/samples/client/petstore/python-legacy/tox.ini deleted file mode 100644 index 169d895329bf..000000000000 --- a/samples/client/petstore/python-legacy/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py27, py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/client/petstore/python-prior/.gitignore b/samples/client/petstore/python-prior/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/client/petstore/python-prior/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/client/petstore/python-prior/.gitlab-ci.yml b/samples/client/petstore/python-prior/.gitlab-ci.yml deleted file mode 100644 index 9e84f5176163..000000000000 --- a/samples/client/petstore/python-prior/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.tests: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests - image: python:3.7-alpine -test-3.8: - extends: .tests - image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/client/petstore/python-prior/.openapi-generator-ignore b/samples/client/petstore/python-prior/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/python-prior/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/python-prior/.openapi-generator/FILES b/samples/client/petstore/python-prior/.openapi-generator/FILES deleted file mode 100644 index 9ea159533683..000000000000 --- a/samples/client/petstore/python-prior/.openapi-generator/FILES +++ /dev/null @@ -1,173 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnimalFarm.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/Child.md -docs/ChildAllOf.md -docs/ChildCat.md -docs/ChildCatAllOf.md -docs/ChildDog.md -docs/ChildDogAllOf.md -docs/ChildLizard.md -docs/ChildLizardAllOf.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/Grandparent.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/NumberWithValidations.md -docs/ObjectModelWithRefProps.md -docs/Order.md -docs/Parent.md -docs/ParentAllOf.md -docs/ParentPet.md -docs/Pet.md -docs/PetApi.md -docs/Player.md -docs/Polygon.md -docs/PolygonAllOf.md -docs/ReadOnlyFirst.md -docs/Shape.md -docs/SpecialModelName.md -docs/Square.md -docs/SquareAllOf.md -docs/StoreApi.md -docs/StringBooleanMap.md -docs/StringEnum.md -docs/Tag.md -docs/Triangle.md -docs/TriangleAllOf.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/apis/__init__.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/model/__init__.py -petstore_api/model/additional_properties_any_type.py -petstore_api/model/additional_properties_array.py -petstore_api/model/additional_properties_boolean.py -petstore_api/model/additional_properties_class.py -petstore_api/model/additional_properties_integer.py -petstore_api/model/additional_properties_number.py -petstore_api/model/additional_properties_object.py -petstore_api/model/additional_properties_string.py -petstore_api/model/animal.py -petstore_api/model/animal_farm.py -petstore_api/model/api_response.py -petstore_api/model/array_of_array_of_number_only.py -petstore_api/model/array_of_number_only.py -petstore_api/model/array_test.py -petstore_api/model/capitalization.py -petstore_api/model/cat.py -petstore_api/model/cat_all_of.py -petstore_api/model/category.py -petstore_api/model/child.py -petstore_api/model/child_all_of.py -petstore_api/model/child_cat.py -petstore_api/model/child_cat_all_of.py -petstore_api/model/child_dog.py -petstore_api/model/child_dog_all_of.py -petstore_api/model/child_lizard.py -petstore_api/model/child_lizard_all_of.py -petstore_api/model/class_model.py -petstore_api/model/client.py -petstore_api/model/dog.py -petstore_api/model/dog_all_of.py -petstore_api/model/enum_arrays.py -petstore_api/model/enum_class.py -petstore_api/model/enum_test.py -petstore_api/model/file.py -petstore_api/model/file_schema_test_class.py -petstore_api/model/format_test.py -petstore_api/model/grandparent.py -petstore_api/model/grandparent_animal.py -petstore_api/model/has_only_read_only.py -petstore_api/model/list.py -petstore_api/model/map_test.py -petstore_api/model/mixed_properties_and_additional_properties_class.py -petstore_api/model/model200_response.py -petstore_api/model/model_return.py -petstore_api/model/name.py -petstore_api/model/number_only.py -petstore_api/model/number_with_validations.py -petstore_api/model/object_model_with_ref_props.py -petstore_api/model/order.py -petstore_api/model/parent.py -petstore_api/model/parent_all_of.py -petstore_api/model/parent_pet.py -petstore_api/model/pet.py -petstore_api/model/player.py -petstore_api/model/polygon.py -petstore_api/model/polygon_all_of.py -petstore_api/model/read_only_first.py -petstore_api/model/shape.py -petstore_api/model/special_model_name.py -petstore_api/model/square.py -petstore_api/model/square_all_of.py -petstore_api/model/string_boolean_map.py -petstore_api/model/string_enum.py -petstore_api/model/tag.py -petstore_api/model/triangle.py -petstore_api/model/triangle_all_of.py -petstore_api/model/type_holder_default.py -petstore_api/model/type_holder_example.py -petstore_api/model/user.py -petstore_api/model/xml_item.py -petstore_api/model_utils.py -petstore_api/models/__init__.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/client/petstore/python-prior/.openapi-generator/VERSION b/samples/client/petstore/python-prior/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/client/petstore/python-prior/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-prior/.travis.yml b/samples/client/petstore/python-prior/.travis.yml deleted file mode 100644 index 1fcc4b155964..000000000000 --- a/samples/client/petstore/python-prior/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python-prior/Makefile b/samples/client/petstore/python-prior/Makefile deleted file mode 100644 index a6bbba4a434f..000000000000 --- a/samples/client/petstore/python-prior/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test: clean - bash ./test_python.sh diff --git a/samples/client/petstore/python-prior/README.md b/samples/client/petstore/python-prior/README.md deleted file mode 100644 index ba6cb7bbf8d1..000000000000 --- a/samples/client/petstore/python-prior/README.md +++ /dev/null @@ -1,257 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen - -## Requirements. - -Python >=3.6 - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python - -import time -import petstore_api -from pprint import pprint -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [Child](docs/Child.md) - - [ChildAllOf](docs/ChildAllOf.md) - - [ChildCat](docs/ChildCat.md) - - [ChildCatAllOf](docs/ChildCatAllOf.md) - - [ChildDog](docs/ChildDog.md) - - [ChildDogAllOf](docs/ChildDogAllOf.md) - - [ChildLizard](docs/ChildLizard.md) - - [ChildLizardAllOf](docs/ChildLizardAllOf.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [Grandparent](docs/Grandparent.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [NumberWithValidations](docs/NumberWithValidations.md) - - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [Order](docs/Order.md) - - [Parent](docs/Parent.md) - - [ParentAllOf](docs/ParentAllOf.md) - - [ParentPet](docs/ParentPet.md) - - [Pet](docs/Pet.md) - - [Player](docs/Player.md) - - [Polygon](docs/Polygon.md) - - [PolygonAllOf](docs/PolygonAllOf.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Shape](docs/Shape.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Square](docs/Square.md) - - [SquareAllOf](docs/SquareAllOf.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [StringEnum](docs/StringEnum.md) - - [Tag](docs/Tag.md) - - [Triangle](docs/Triangle.md) - - [TriangleAllOf](docs/TriangleAllOf.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -## Author - - - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from petstore_api.api.default_api import DefaultApi` -- `from petstore_api.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import petstore_api -from petstore_api.apis import * -from petstore_api.models import * -``` - diff --git a/samples/client/petstore/python-prior/dev-requirements.txt b/samples/client/petstore/python-prior/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/client/petstore/python-prior/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index d31d12de0822..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesAnyType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 40537cbf8384..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesArray - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index bf7b5be4c13d..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesBoolean - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 3ba7bab6f3d0..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,22 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_string** | **{str: (str,)}** | | [optional] -**map_number** | **{str: (float,)}** | | [optional] -**map_integer** | **{str: (int,)}** | | [optional] -**map_boolean** | **{str: (bool,)}** | | [optional] -**map_array_integer** | **{str: ([int],)}** | | [optional] -**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}** | | [optional] -**map_map_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}** | | [optional] -**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] -**anytype_2** | **bool, date, datetime, dict, float, int, list, str, none_type** | no type is set for this | [optional] -**anytype_3** | **bool, date, datetime, dict, float, int, list, str, none_type** | because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378 | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 96345efd4cc8..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 9af52dc6dcfd..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesNumber - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **float** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md deleted file mode 100644 index dc64a0d91c24..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type,)}** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md deleted file mode 100644 index fe3993d02265..000000000000 --- a/samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesString - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **str** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Animal.md b/samples/client/petstore/python-prior/docs/Animal.md deleted file mode 100644 index d36c66a5d882..000000000000 --- a/samples/client/petstore/python-prior/docs/Animal.md +++ /dev/null @@ -1,13 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AnimalFarm.md b/samples/client/petstore/python-prior/docs/AnimalFarm.md deleted file mode 100644 index fc299cf27d34..000000000000 --- a/samples/client/petstore/python-prior/docs/AnimalFarm.md +++ /dev/null @@ -1,11 +0,0 @@ -# AnimalFarm - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**[Animal]**](Animal.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/AnotherFakeApi.md b/samples/client/petstore/python-prior/docs/AnotherFakeApi.md deleted file mode 100644 index d2d58609c8be..000000000000 --- a/samples/client/petstore/python-prior/docs/AnotherFakeApi.md +++ /dev/null @@ -1,78 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(body) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/ApiResponse.md b/samples/client/petstore/python-prior/docs/ApiResponse.md deleted file mode 100644 index bedefea9a9cb..000000000000 --- a/samples/client/petstore/python-prior/docs/ApiResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 11cd25c98ee4..000000000000 --- a/samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **[[float]]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 1e9bb12e4e8b..000000000000 --- a/samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **[float]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ArrayTest.md b/samples/client/petstore/python-prior/docs/ArrayTest.md deleted file mode 100644 index 9eac1f8874c4..000000000000 --- a/samples/client/petstore/python-prior/docs/ArrayTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **[str]** | | [optional] -**array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Capitalization.md b/samples/client/petstore/python-prior/docs/Capitalization.md deleted file mode 100644 index df9989f8db57..000000000000 --- a/samples/client/petstore/python-prior/docs/Capitalization.md +++ /dev/null @@ -1,17 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Cat.md b/samples/client/petstore/python-prior/docs/Cat.md deleted file mode 100644 index 082715a28421..000000000000 --- a/samples/client/petstore/python-prior/docs/Cat.md +++ /dev/null @@ -1,14 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**declawed** | **bool** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/CatAllOf.md b/samples/client/petstore/python-prior/docs/CatAllOf.md deleted file mode 100644 index 6fd1390a749b..000000000000 --- a/samples/client/petstore/python-prior/docs/CatAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Category.md b/samples/client/petstore/python-prior/docs/Category.md deleted file mode 100644 index 7650eccafba5..000000000000 --- a/samples/client/petstore/python-prior/docs/Category.md +++ /dev/null @@ -1,13 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | defaults to "default-name" -**id** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Child.md b/samples/client/petstore/python-prior/docs/Child.md deleted file mode 100644 index 6bf6903fb203..000000000000 --- a/samples/client/petstore/python-prior/docs/Child.md +++ /dev/null @@ -1,14 +0,0 @@ -# Child - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] -**tele_vision** | **bool** | | [optional] -**inter_net** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildAllOf.md b/samples/client/petstore/python-prior/docs/ChildAllOf.md deleted file mode 100644 index bae8ced90067..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inter_net** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildCat.md b/samples/client/petstore/python-prior/docs/ChildCat.md deleted file mode 100644 index 513903ac5793..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildCat.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChildCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildCatAllOf.md b/samples/client/petstore/python-prior/docs/ChildCatAllOf.md deleted file mode 100644 index c5b2f58f28ce..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildCatAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildDog.md b/samples/client/petstore/python-prior/docs/ChildDog.md deleted file mode 100644 index e5b410ce1e79..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildDog.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChildDog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**bark** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildDogAllOf.md b/samples/client/petstore/python-prior/docs/ChildDogAllOf.md deleted file mode 100644 index 45928c57ef2a..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildDogAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildDogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bark** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildLizard.md b/samples/client/petstore/python-prior/docs/ChildLizard.md deleted file mode 100644 index d2e22826e77f..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildLizard.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChildLizard - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**loves_rocks** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ChildLizardAllOf.md b/samples/client/petstore/python-prior/docs/ChildLizardAllOf.md deleted file mode 100644 index 6effcfd9313f..000000000000 --- a/samples/client/petstore/python-prior/docs/ChildLizardAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildLizardAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loves_rocks** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ClassModel.md b/samples/client/petstore/python-prior/docs/ClassModel.md deleted file mode 100644 index 6605a16d74a9..000000000000 --- a/samples/client/petstore/python-prior/docs/ClassModel.md +++ /dev/null @@ -1,13 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Client.md b/samples/client/petstore/python-prior/docs/Client.md deleted file mode 100644 index 1b293140f348..000000000000 --- a/samples/client/petstore/python-prior/docs/Client.md +++ /dev/null @@ -1,12 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Dog.md b/samples/client/petstore/python-prior/docs/Dog.md deleted file mode 100644 index 51b5b32bdacb..000000000000 --- a/samples/client/petstore/python-prior/docs/Dog.md +++ /dev/null @@ -1,14 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**breed** | **str** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/DogAllOf.md b/samples/client/petstore/python-prior/docs/DogAllOf.md deleted file mode 100644 index 2907a9fd5c43..000000000000 --- a/samples/client/petstore/python-prior/docs/DogAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/EnumArrays.md b/samples/client/petstore/python-prior/docs/EnumArrays.md deleted file mode 100644 index ad4e9d2fcb7c..000000000000 --- a/samples/client/petstore/python-prior/docs/EnumArrays.md +++ /dev/null @@ -1,13 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **[str]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/EnumClass.md b/samples/client/petstore/python-prior/docs/EnumClass.md deleted file mode 100644 index a1f9aae58190..000000000000 --- a/samples/client/petstore/python-prior/docs/EnumClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/EnumTest.md b/samples/client/petstore/python-prior/docs/EnumTest.md deleted file mode 100644 index 052596bfd045..000000000000 --- a/samples/client/petstore/python-prior/docs/EnumTest.md +++ /dev/null @@ -1,16 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string_required** | **str** | | -**enum_string** | **str** | | [optional] -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/FakeApi.md b/samples/client/petstore/python-prior/docs/FakeApi.md deleted file mode 100644 index cef1d93c186a..000000000000 --- a/samples/client/petstore/python-prior/docs/FakeApi.md +++ /dev/null @@ -1,1239 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -[**string**](FakeApi.md#string) | **POST** /fake/refs/string | -[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **array_model** -> AnimalFarm array_model() - - - -Test serialization of ArrayModel - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.animal_farm import AnimalFarm -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = AnimalFarm([ - Animal(), - ]) # AnimalFarm | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.array_model(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] - -### Return type - -[**AnimalFarm**](AnimalFarm.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **boolean** -> bool boolean() - - - -Test serialization of outer boolean types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.boolean(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->boolean: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_xml_item** -> create_xml_item(xml_item) - -creates an XmlItem - -this route creates an XmlItem - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.xml_item import XmlItem -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - xml_item = XmlItem( - attribute_string="string", - attribute_number=1.234, - attribute_integer=-2, - attribute_boolean=True, - wrapped_array=[ - 1, - ], - name_string="string", - name_number=1.234, - name_integer=-2, - name_boolean=True, - name_array=[ - 1, - ], - name_wrapped_array=[ - 1, - ], - prefix_string="string", - prefix_number=1.234, - prefix_integer=-2, - prefix_boolean=True, - prefix_array=[ - 1, - ], - prefix_wrapped_array=[ - 1, - ], - namespace_string="string", - namespace_number=1.234, - namespace_integer=-2, - namespace_boolean=True, - namespace_array=[ - 1, - ], - namespace_wrapped_array=[ - 1, - ], - prefix_ns_string="string", - prefix_ns_number=1.234, - prefix_ns_integer=-2, - prefix_ns_boolean=True, - prefix_ns_array=[ - 1, - ], - prefix_ns_wrapped_array=[ - 1, - ], - ) # XmlItem | XmlItem Body - - # example passing only required values which don't have defaults set - try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **number_with_validations** -> NumberWithValidations number_with_validations() - - - -Test serialization of outer number types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.number_with_validations import NumberWithValidations -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = NumberWithValidations(1E+1) # NumberWithValidations | Input number as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.number_with_validations(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->number_with_validations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] - -### Return type - -[**NumberWithValidations**](NumberWithValidations.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **object_model_with_ref_props** -> ObjectModelWithRefProps object_model_with_ref_props() - - - -Test serialization of object with $refed properties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = ObjectModelWithRefProps( - my_number=NumberWithValidations(1E+1), - my_string="my_string_example", - my_boolean=True, - ) # ObjectModelWithRefProps | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.object_model_with_ref_props(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] - -### Return type - -[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string** -> str string() - - - -Test serialization of outer string types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = "body_example" # str | Input string as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string_enum** -> StringEnum string_enum() - - - -Test serialization of outer enum - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.string_enum import StringEnum -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = StringEnum("placed") # StringEnum | Input enum (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string_enum(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string_enum: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] - -### Return type - -[**StringEnum**](StringEnum.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output enum | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = FileSchemaTestClass( - file=File( - source_uri="source_uri_example", - ), - files=[ - File( - source_uri="source_uri_example", - ), - ], - ) # FileSchemaTestClass | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_file_schema(body) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, body) - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - query = "query_example" # str | - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_query_params(query, body) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(body) - -To test \"client\" model - -To test \"client\" model - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_enums_length_one** -> test_endpoint_enums_length_one() - - - -This route has required values with enums of 1 - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - try: - api_instance.test_endpoint_enums_length_one() - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query_integer** | **int**| | defaults to 3 - **query_string** | **str**| | defaults to "brillig" - **path_string** | **str**| | defaults to "hello" - **path_integer** | **int**| | defaults to 34 - **header_number** | **float**| | defaults to 1.234 - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - number = 32.1 # float | None - double = 67.8 # float | None - pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>" # str | None - byte = 'YQ==' # str | None - integer = 10 # int | None (optional) - int32 = 20 # int | None (optional) - int64 = 1 # int | None (optional) - float = 3.14 # float | None (optional) - string = "A" # str | None (optional) - binary = open('/path/to/file', 'rb') # file_type | None (optional) - date = dateutil_parser('1970-01-01').date() # date | None (optional) - date_time = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | None (optional) - password = "password_example" # str | None (optional) - param_callback = "param_callback_example" # str | None (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file_type**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters() - -To test enum parameters - -To test enum parameters - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - enum_header_string_array = [ - "$", - ] # [str] | Header parameter enum test (string array) (optional) - enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_string_array = [ - "$", - ] # [str] | Query parameter enum test (string array) (optional) - enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_integer = 1 # int | Query parameter enum test (double) (optional) - enum_query_double = 1.1 # float | Query parameter enum test (double) (optional) - enum_form_string_array = [ - "$", - ] # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$" - enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - - # example passing only required values which don't have defaults set - # and optional values - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$" - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - required_string_group = 1 # int | Required String in group parameters - required_boolean_group = True # bool | Required Boolean in group parameters - required_int64_group = 1 # int | Required Integer in group parameters - string_group = 1 # int | String in group parameters (optional) - boolean_group = True # bool | Boolean in group parameters (optional) - int64_group = 1 # int | Integer in group parameters (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(param) - -test inline additionalProperties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - param = { - "key": "key_example", - } # {str: (str,)} | request body - - # example passing only required values which don't have defaults set - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **{str: (str,)}**| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - param = "param_example" # str | field1 - param2 = "param2_example" # str | field2 - - # example passing only required values which don't have defaults set - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 411d4bb4b745..000000000000 --- a/samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,89 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(body) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): - -```python -import time -import petstore_api -from petstore_api.api import fake_classname_tags123_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/File.md b/samples/client/petstore/python-prior/docs/File.md deleted file mode 100644 index f84547d19331..000000000000 --- a/samples/client/petstore/python-prior/docs/File.md +++ /dev/null @@ -1,13 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/FileSchemaTestClass.md b/samples/client/petstore/python-prior/docs/FileSchemaTestClass.md deleted file mode 100644 index 4572aa0905b3..000000000000 --- a/samples/client/petstore/python-prior/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**[File]**](File.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/FormatTest.md b/samples/client/petstore/python-prior/docs/FormatTest.md deleted file mode 100644 index dbb4c3e6683d..000000000000 --- a/samples/client/petstore/python-prior/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | | -**byte** | **str** | | -**date** | **date** | | -**password** | **str** | | -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**binary** | **file_type** | | [optional] -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Grandparent.md b/samples/client/petstore/python-prior/docs/Grandparent.md deleted file mode 100644 index af143938ab51..000000000000 --- a/samples/client/petstore/python-prior/docs/Grandparent.md +++ /dev/null @@ -1,12 +0,0 @@ -# Grandparent - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/GrandparentAnimal.md b/samples/client/petstore/python-prior/docs/GrandparentAnimal.md deleted file mode 100644 index a1c340378106..000000000000 --- a/samples/client/petstore/python-prior/docs/GrandparentAnimal.md +++ /dev/null @@ -1,12 +0,0 @@ -# GrandparentAnimal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md deleted file mode 100644 index 88bc03d4ff5c..000000000000 --- a/samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,13 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/List.md b/samples/client/petstore/python-prior/docs/List.md deleted file mode 100644 index 13f2694de358..000000000000 --- a/samples/client/petstore/python-prior/docs/List.md +++ /dev/null @@ -1,12 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/MapTest.md b/samples/client/petstore/python-prior/docs/MapTest.md deleted file mode 100644 index e6584f3811e0..000000000000 --- a/samples/client/petstore/python-prior/docs/MapTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_of_enum_string** | **{str: (str,)}** | | [optional] -**direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f32c4e04134b..000000000000 --- a/samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Model200Response.md b/samples/client/petstore/python-prior/docs/Model200Response.md deleted file mode 100644 index f7ef7d79acf6..000000000000 --- a/samples/client/petstore/python-prior/docs/Model200Response.md +++ /dev/null @@ -1,14 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ModelReturn.md b/samples/client/petstore/python-prior/docs/ModelReturn.md deleted file mode 100644 index 75fb39a88698..000000000000 --- a/samples/client/petstore/python-prior/docs/ModelReturn.md +++ /dev/null @@ -1,13 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Model_200Response.md b/samples/client/petstore/python-prior/docs/Model_200Response.md deleted file mode 100644 index 3d5777b2b108..000000000000 --- a/samples/client/petstore/python-prior/docs/Model_200Response.md +++ /dev/null @@ -1,14 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Model_Return.md b/samples/client/petstore/python-prior/docs/Model_Return.md deleted file mode 100644 index d9c1a2d8119b..000000000000 --- a/samples/client/petstore/python-prior/docs/Model_Return.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Name.md b/samples/client/petstore/python-prior/docs/Name.md deleted file mode 100644 index 6e58fae6d0bb..000000000000 --- a/samples/client/petstore/python-prior/docs/Name.md +++ /dev/null @@ -1,16 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/NumberOnly.md b/samples/client/petstore/python-prior/docs/NumberOnly.md deleted file mode 100644 index 172e86163a44..000000000000 --- a/samples/client/petstore/python-prior/docs/NumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/NumberWithValidations.md b/samples/client/petstore/python-prior/docs/NumberWithValidations.md deleted file mode 100644 index 119e0f678239..000000000000 --- a/samples/client/petstore/python-prior/docs/NumberWithValidations.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberWithValidations - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md deleted file mode 100644 index a0d15f4bbd15..000000000000 --- a/samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md +++ /dev/null @@ -1,15 +0,0 @@ -# ObjectModelWithRefProps - -a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Order.md b/samples/client/petstore/python-prior/docs/Order.md deleted file mode 100644 index 0423082932d5..000000000000 --- a/samples/client/petstore/python-prior/docs/Order.md +++ /dev/null @@ -1,17 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] if omitted the server will use the default value of False -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Parent.md b/samples/client/petstore/python-prior/docs/Parent.md deleted file mode 100644 index 9db770844ee1..000000000000 --- a/samples/client/petstore/python-prior/docs/Parent.md +++ /dev/null @@ -1,13 +0,0 @@ -# Parent - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] -**tele_vision** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ParentAllOf.md b/samples/client/petstore/python-prior/docs/ParentAllOf.md deleted file mode 100644 index 84ac2c066eed..000000000000 --- a/samples/client/petstore/python-prior/docs/ParentAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ParentAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tele_vision** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ParentPet.md b/samples/client/petstore/python-prior/docs/ParentPet.md deleted file mode 100644 index 111ada88b3d1..000000000000 --- a/samples/client/petstore/python-prior/docs/ParentPet.md +++ /dev/null @@ -1,12 +0,0 @@ -# ParentPet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Pet.md b/samples/client/petstore/python-prior/docs/Pet.md deleted file mode 100644 index e0b129784564..000000000000 --- a/samples/client/petstore/python-prior/docs/Pet.md +++ /dev/null @@ -1,17 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**photo_urls** | **[str]** | | -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/PetApi.md b/samples/client/petstore/python-prior/docs/PetApi.md deleted file mode 100644 index 70252451912d..000000000000 --- a/samples/client/petstore/python-prior/docs/PetApi.md +++ /dev/null @@ -1,802 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(body) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - full_name="full_name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Add a new pet to the store - api_instance.add_pet(body) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | Pet id to delete - api_key = "api_key_example" # str | (optional) - - # example passing only required values which don't have defaults set - try: - # Deletes a pet - api_instance.delete_pet(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> [Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - status = [ - "available", - ] # [str] | Status values that need to be considered for filter - - # example passing only required values which don't have defaults set - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **[str]**| Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> [Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - tags = [ - "tags_example", - ] # [str] | Tags to filter by - - # example passing only required values which don't have defaults set - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | **[str]**| Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to return - - # example passing only required values which don't have defaults set - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(body) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - full_name="full_name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Update an existing pet - api_instance.update_pet(body) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet that needs to be updated - name = "name_example" # str | Updated name of the pet (optional) - status = "status_example" # str | Updated status of the pet (optional) - - # example passing only required values which don't have defaults set - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to update - additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) - file = open('/path/to/file', 'rb') # file_type | file to upload (optional) - files = [ -null, - ] # [file_type] | files to upload (optional) - - # example passing only required values which don't have defaults set - try: - # uploads an image - api_response = api_instance.upload_file(pet_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file_type**| file to upload | [optional] - **files** | **[file_type]**| files to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to update - required_file = open('/path/to/file', 'rb') # file_type | file to upload - additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) - - # example passing only required values which don't have defaults set - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file_type**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/Player.md b/samples/client/petstore/python-prior/docs/Player.md deleted file mode 100644 index 97441ae316bb..000000000000 --- a/samples/client/petstore/python-prior/docs/Player.md +++ /dev/null @@ -1,13 +0,0 @@ -# Player - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**enemy_player** | [**Player**](Player.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Polygon.md b/samples/client/petstore/python-prior/docs/Polygon.md deleted file mode 100644 index 586c509a41e5..000000000000 --- a/samples/client/petstore/python-prior/docs/Polygon.md +++ /dev/null @@ -1,14 +0,0 @@ -# Polygon - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**area** | **str** | | [optional] -**sides** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/PolygonAllOf.md b/samples/client/petstore/python-prior/docs/PolygonAllOf.md deleted file mode 100644 index 66548f78b747..000000000000 --- a/samples/client/petstore/python-prior/docs/PolygonAllOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# PolygonAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**sides** | **int** | | [optional] -**area** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/ReadOnlyFirst.md b/samples/client/petstore/python-prior/docs/ReadOnlyFirst.md deleted file mode 100644 index ba39ec3d04e4..000000000000 --- a/samples/client/petstore/python-prior/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,13 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Shape.md b/samples/client/petstore/python-prior/docs/Shape.md deleted file mode 100644 index 520db56a6fc5..000000000000 --- a/samples/client/petstore/python-prior/docs/Shape.md +++ /dev/null @@ -1,13 +0,0 @@ -# Shape - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**area** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/SpecialModelName.md b/samples/client/petstore/python-prior/docs/SpecialModelName.md deleted file mode 100644 index 4a1c86ff4de0..000000000000 --- a/samples/client/petstore/python-prior/docs/SpecialModelName.md +++ /dev/null @@ -1,12 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Square.md b/samples/client/petstore/python-prior/docs/Square.md deleted file mode 100644 index 901633cc6a40..000000000000 --- a/samples/client/petstore/python-prior/docs/Square.md +++ /dev/null @@ -1,14 +0,0 @@ -# Square - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | defaults to "Square" -**area** | **str** | | [optional] -**sides** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/SquareAllOf.md b/samples/client/petstore/python-prior/docs/SquareAllOf.md deleted file mode 100644 index ad9520092db4..000000000000 --- a/samples/client/petstore/python-prior/docs/SquareAllOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# SquareAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | [optional] if omitted the server will use the default value of "Square" -**sides** | **int** | | [optional] -**area** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/StoreApi.md b/samples/client/petstore/python-prior/docs/StoreApi.md deleted file mode 100644 index 95a40cf27acd..000000000000 --- a/samples/client/petstore/python-prior/docs/StoreApi.md +++ /dev/null @@ -1,293 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = "order_id_example" # str | ID of the order that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> {str: (int,)} get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (int,)}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = 1 # int | ID of pet that needs to be fetched - - # example passing only required values which don't have defaults set - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(body) - -Place an order for a pet - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - body = Order( - id=1, - pet_id=1, - quantity=1, - ship_date=dateutil_parser('1970-01-01T00:00:00.00Z'), - status="placed", - complete=False, - ) # Order | order placed for purchasing the pet - - # example passing only required values which don't have defaults set - try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/StringBooleanMap.md b/samples/client/petstore/python-prior/docs/StringBooleanMap.md deleted file mode 100644 index 217c79704081..000000000000 --- a/samples/client/petstore/python-prior/docs/StringBooleanMap.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringBooleanMap - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/StringEnum.md b/samples/client/petstore/python-prior/docs/StringEnum.md deleted file mode 100644 index bb195ec0e453..000000000000 --- a/samples/client/petstore/python-prior/docs/StringEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["placed", "approved", "delivered", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Tag.md b/samples/client/petstore/python-prior/docs/Tag.md deleted file mode 100644 index bfe06d1c5bfe..000000000000 --- a/samples/client/petstore/python-prior/docs/Tag.md +++ /dev/null @@ -1,14 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] -**full_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/Triangle.md b/samples/client/petstore/python-prior/docs/Triangle.md deleted file mode 100644 index 28f18053371d..000000000000 --- a/samples/client/petstore/python-prior/docs/Triangle.md +++ /dev/null @@ -1,14 +0,0 @@ -# Triangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | defaults to "Triangle" -**area** | **str** | | [optional] -**sides** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/TriangleAllOf.md b/samples/client/petstore/python-prior/docs/TriangleAllOf.md deleted file mode 100644 index 44b8c0581cc1..000000000000 --- a/samples/client/petstore/python-prior/docs/TriangleAllOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# TriangleAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | [optional] if omitted the server will use the default value of "Triangle" -**sides** | **int** | | [optional] -**area** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/TypeHolderDefault.md b/samples/client/petstore/python-prior/docs/TypeHolderDefault.md deleted file mode 100644 index f15c61cc4618..000000000000 --- a/samples/client/petstore/python-prior/docs/TypeHolderDefault.md +++ /dev/null @@ -1,19 +0,0 @@ -# TypeHolderDefault - -a model to test optional properties with server defaults - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_item** | **[int]** | | -**string_item** | **str** | | defaults to "what" -**number_item** | **float** | | defaults to 1.234 -**integer_item** | **int** | | defaults to -2 -**bool_item** | **bool** | | defaults to True -**date_item** | **date** | | [optional] -**datetime_item** | **datetime** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/TypeHolderExample.md b/samples/client/petstore/python-prior/docs/TypeHolderExample.md deleted file mode 100644 index d707ca3af203..000000000000 --- a/samples/client/petstore/python-prior/docs/TypeHolderExample.md +++ /dev/null @@ -1,17 +0,0 @@ -# TypeHolderExample - -a model to test required properties with an example and length one enum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bool_item** | **bool** | | -**array_item** | **[int]** | | -**string_item** | **str** | | defaults to "what" -**number_item** | **float** | | defaults to 1.234 -**integer_item** | **int** | | defaults to -2 -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/User.md b/samples/client/petstore/python-prior/docs/User.md deleted file mode 100644 index 8e677b63cca6..000000000000 --- a/samples/client/petstore/python-prior/docs/User.md +++ /dev/null @@ -1,19 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/docs/UserApi.md b/samples/client/petstore/python-prior/docs/UserApi.md deleted file mode 100644 index 9f90c838493a..000000000000 --- a/samples/client/petstore/python-prior/docs/UserApi.md +++ /dev/null @@ -1,578 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(body) - -Create user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | Created user object - - # example passing only required values which don't have defaults set - try: - # Create user - api_instance.create_user(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(body) - -Creates list of users with given input array - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(body) - -Creates list of users with given input array - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete user - api_instance.delete_user(username) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be fetched. Use user1 for testing. - - # example passing only required values which don't have defaults set - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The user name for login - password = "password_example" # str | The password for login in clear text - - # example passing only required values which don't have defaults set - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Logs out current logged in user session - api_instance.logout_user() - except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | name that need to be deleted - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | Updated user object - - # example passing only required values which don't have defaults set - try: - # Updated user - api_instance.update_user(username, body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior/docs/XmlItem.md b/samples/client/petstore/python-prior/docs/XmlItem.md deleted file mode 100644 index 9852234a7367..000000000000 --- a/samples/client/petstore/python-prior/docs/XmlItem.md +++ /dev/null @@ -1,40 +0,0 @@ -# XmlItem - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **str** | | [optional] -**attribute_number** | **float** | | [optional] -**attribute_integer** | **int** | | [optional] -**attribute_boolean** | **bool** | | [optional] -**wrapped_array** | **[int]** | | [optional] -**name_string** | **str** | | [optional] -**name_number** | **float** | | [optional] -**name_integer** | **int** | | [optional] -**name_boolean** | **bool** | | [optional] -**name_array** | **[int]** | | [optional] -**name_wrapped_array** | **[int]** | | [optional] -**prefix_string** | **str** | | [optional] -**prefix_number** | **float** | | [optional] -**prefix_integer** | **int** | | [optional] -**prefix_boolean** | **bool** | | [optional] -**prefix_array** | **[int]** | | [optional] -**prefix_wrapped_array** | **[int]** | | [optional] -**namespace_string** | **str** | | [optional] -**namespace_number** | **float** | | [optional] -**namespace_integer** | **int** | | [optional] -**namespace_boolean** | **bool** | | [optional] -**namespace_array** | **[int]** | | [optional] -**namespace_wrapped_array** | **[int]** | | [optional] -**prefix_ns_string** | **str** | | [optional] -**prefix_ns_number** | **float** | | [optional] -**prefix_ns_integer** | **int** | | [optional] -**prefix_ns_boolean** | **bool** | | [optional] -**prefix_ns_array** | **[int]** | | [optional] -**prefix_ns_wrapped_array** | **[int]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior/git_push.sh b/samples/client/petstore/python-prior/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/python-prior/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/python-prior/petstore_api/__init__.py b/samples/client/petstore/python-prior/petstore_api/__init__.py deleted file mode 100644 index 26dd6f84e215..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from petstore_api.api_client import ApiClient - -# import Configuration -from petstore_api.configuration import Configuration - -# import exceptions -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException diff --git a/samples/client/petstore/python-prior/petstore_api/api/__init__.py b/samples/client/petstore/python-prior/petstore_api/api/__init__.py deleted file mode 100644 index 840e9f0cd908..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from petstore_api.apis import AnotherFakeApi diff --git a/samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py deleted file mode 100644 index d54ded04e311..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,171 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/another-fake/dummy', - 'operation_id': 'call_123_test_special_tags', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/fake_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_api.py deleted file mode 100644 index 98536575b077..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2464 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.client import Client -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.user import User -from petstore_api.model.xml_item import XmlItem - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.array_model_endpoint = _Endpoint( - settings={ - 'response_type': (AnimalFarm,), - 'auth': [], - 'endpoint_path': '/fake/refs/arraymodel', - 'operation_id': 'array_model', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (AnimalFarm,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.boolean_endpoint = _Endpoint( - settings={ - 'response_type': (bool,), - 'auth': [], - 'endpoint_path': '/fake/refs/boolean', - 'operation_id': 'boolean', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (bool,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.create_xml_item_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/create_xml_item', - 'operation_id': 'create_xml_item', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'xml_item', - ], - 'required': [ - 'xml_item', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'xml_item': - (XmlItem,), - }, - 'attribute_map': { - }, - 'location_map': { - 'xml_item': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/xml', - 'application/xml; charset=utf-8', - 'application/xml; charset=utf-16', - 'text/xml', - 'text/xml; charset=utf-8', - 'text/xml; charset=utf-16' - ] - }, - api_client=api_client - ) - self.number_with_validations_endpoint = _Endpoint( - settings={ - 'response_type': (NumberWithValidations,), - 'auth': [], - 'endpoint_path': '/fake/refs/number', - 'operation_id': 'number_with_validations', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (NumberWithValidations,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.object_model_with_ref_props_endpoint = _Endpoint( - settings={ - 'response_type': (ObjectModelWithRefProps,), - 'auth': [], - 'endpoint_path': '/fake/refs/object_model_with_ref_props', - 'operation_id': 'object_model_with_ref_props', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (ObjectModelWithRefProps,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.string_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/fake/refs/string', - 'operation_id': 'string', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (str,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.string_enum_endpoint = _Endpoint( - settings={ - 'response_type': (StringEnum,), - 'auth': [], - 'endpoint_path': '/fake/refs/enum', - 'operation_id': 'string_enum', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (StringEnum,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.test_body_with_file_schema_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-file-schema', - 'operation_id': 'test_body_with_file_schema', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (FileSchemaTestClass,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_body_with_query_params_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-query-params', - 'operation_id': 'test_body_with_query_params', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'query', - 'body', - ], - 'required': [ - 'query', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'query': - (str,), - 'body': - (User,), - }, - 'attribute_map': { - 'query': 'query', - }, - 'location_map': { - 'query': 'query', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_client_model_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_client_model', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_endpoint_enums_length_one_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}', - 'operation_id': 'test_endpoint_enums_length_one', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'required': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'nullable': [ - ], - 'enum': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('query_integer',): { - - "3": 3 - }, - ('query_string',): { - - "BRILLIG": "brillig" - }, - ('path_string',): { - - "HELLO": "hello" - }, - ('path_integer',): { - - "34": 34 - }, - ('header_number',): { - - "1.234": 1.234 - }, - }, - 'openapi_types': { - 'query_integer': - (int,), - 'query_string': - (str,), - 'path_string': - (str,), - 'path_integer': - (int,), - 'header_number': - (float,), - }, - 'attribute_map': { - 'query_integer': 'query_integer', - 'query_string': 'query_string', - 'path_string': 'path_string', - 'path_integer': 'path_integer', - 'header_number': 'header_number', - }, - 'location_map': { - 'query_integer': 'query', - 'query_string': 'query', - 'path_string': 'path', - 'path_integer': 'path', - 'header_number': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.test_endpoint_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'http_basic_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_endpoint_parameters', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback', - ], - 'required': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'integer', - 'int32', - 'float', - 'string', - 'password', - ] - }, - root_map={ - 'validations': { - ('number',): { - - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('double',): { - - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('pattern_without_delimiter',): { - - 'regex': { - 'pattern': r'^[A-Z].*', # noqa: E501 - }, - }, - ('integer',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - - 'inclusive_maximum': 987.6, - }, - ('string',): { - - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'number': - (float,), - 'double': - (float,), - 'pattern_without_delimiter': - (str,), - 'byte': - (str,), - 'integer': - (int,), - 'int32': - (int,), - 'int64': - (int,), - 'float': - (float,), - 'string': - (str,), - 'binary': - (file_type,), - 'date': - (date,), - 'date_time': - (datetime,), - 'password': - (str,), - 'param_callback': - (str,), - }, - 'attribute_map': { - 'number': 'number', - 'double': 'double', - 'pattern_without_delimiter': 'pattern_without_delimiter', - 'byte': 'byte', - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'float': 'float', - 'string': 'string', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'password': 'password', - 'param_callback': 'callback', - }, - 'location_map': { - 'number': 'form', - 'double': 'form', - 'pattern_without_delimiter': 'form', - 'byte': 'form', - 'integer': 'form', - 'int32': 'form', - 'int64': 'form', - 'float': 'form', - 'string': 'form', - 'binary': 'form', - 'date': 'form', - 'date_time': 'form', - 'password': 'form', - 'param_callback': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_enum_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_enum_parameters', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('enum_header_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_header_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_query_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_integer',): { - - "1": 1, - "-2": -2 - }, - ('enum_query_double',): { - - "1.1": 1.1, - "-1.2": -1.2 - }, - ('enum_form_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_form_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - }, - 'openapi_types': { - 'enum_header_string_array': - ([str],), - 'enum_header_string': - (str,), - 'enum_query_string_array': - ([str],), - 'enum_query_string': - (str,), - 'enum_query_integer': - (int,), - 'enum_query_double': - (float,), - 'enum_form_string_array': - ([str],), - 'enum_form_string': - (str,), - }, - 'attribute_map': { - 'enum_header_string_array': 'enum_header_string_array', - 'enum_header_string': 'enum_header_string', - 'enum_query_string_array': 'enum_query_string_array', - 'enum_query_string': 'enum_query_string', - 'enum_query_integer': 'enum_query_integer', - 'enum_query_double': 'enum_query_double', - 'enum_form_string_array': 'enum_form_string_array', - 'enum_form_string': 'enum_form_string', - }, - 'location_map': { - 'enum_header_string_array': 'header', - 'enum_header_string': 'header', - 'enum_query_string_array': 'query', - 'enum_query_string': 'query', - 'enum_query_integer': 'query', - 'enum_query_double': 'query', - 'enum_form_string_array': 'form', - 'enum_form_string': 'form', - }, - 'collection_format_map': { - 'enum_header_string_array': 'csv', - 'enum_query_string_array': 'csv', - 'enum_form_string_array': 'csv', - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_group_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_group_parameters', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group', - ], - 'required': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'required_string_group': - (int,), - 'required_boolean_group': - (bool,), - 'required_int64_group': - (int,), - 'string_group': - (int,), - 'boolean_group': - (bool,), - 'int64_group': - (int,), - }, - 'attribute_map': { - 'required_string_group': 'required_string_group', - 'required_boolean_group': 'required_boolean_group', - 'required_int64_group': 'required_int64_group', - 'string_group': 'string_group', - 'boolean_group': 'boolean_group', - 'int64_group': 'int64_group', - }, - 'location_map': { - 'required_string_group': 'query', - 'required_boolean_group': 'header', - 'required_int64_group': 'query', - 'string_group': 'query', - 'boolean_group': 'header', - 'int64_group': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.test_inline_additional_properties_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/inline-additionalProperties', - 'operation_id': 'test_inline_additional_properties', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'param', - ], - 'required': [ - 'param', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': - ({str: (str,)},), - }, - 'attribute_map': { - }, - 'location_map': { - 'param': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_json_form_data_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/jsonFormData', - 'operation_id': 'test_json_form_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'param', - 'param2', - ], - 'required': [ - 'param', - 'param2', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': - (str,), - 'param2': - (str,), - }, - 'attribute_map': { - 'param': 'param', - 'param2': 'param2', - }, - 'location_map': { - 'param': 'form', - 'param2': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['xml_item'] = \ - xml_item - return self.create_xml_item_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['param'] = \ - param - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index e6abced84092..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index 69537296f488..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/pet_api.py b/samples/client/petstore/python-prior/petstore_api/api/pet_api.py deleted file mode 100644 index af164a6ce79c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1306 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.pet import Pet - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.add_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'add_pet', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.delete_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'delete_pet', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'api_key', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'api_key': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'api_key': 'api_key', - }, - 'location_map': { - 'pet_id': 'path', - 'api_key': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_status_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByStatus', - 'operation_id': 'find_pets_by_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'status', - ], - 'required': [ - 'status', - ], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('status',): { - - "AVAILABLE": "available", - "PENDING": "pending", - "SOLD": "sold" - }, - }, - 'openapi_types': { - 'status': - ([str],), - }, - 'attribute_map': { - 'status': 'status', - }, - 'location_map': { - 'status': 'query', - }, - 'collection_format_map': { - 'status': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_tags_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByTags', - 'operation_id': 'find_pets_by_tags', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'tags', - ], - 'required': [ - 'tags', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'tags': - ([str],), - }, - 'attribute_map': { - 'tags': 'tags', - }, - 'location_map': { - 'tags': 'query', - }, - 'collection_format_map': { - 'tags': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_pet_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Pet,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'get_pet_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - }, - 'attribute_map': { - 'pet_id': 'petId', - }, - 'location_map': { - 'pet_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'update_pet', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.update_pet_with_form_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'update_pet_with_form', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'name', - 'status', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'name': - (str,), - 'status': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'name': 'name', - 'status': 'status', - }, - 'location_map': { - 'pet_id': 'path', - 'name': 'form', - 'status': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.upload_file_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}/uploadImage', - 'operation_id': 'upload_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'additional_metadata', - 'file', - 'files', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'additional_metadata': - (str,), - 'file': - (file_type,), - 'files': - ([file_type],), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'additional_metadata': 'additionalMetadata', - 'file': 'file', - 'files': 'files', - }, - 'location_map': { - 'pet_id': 'path', - 'additional_metadata': 'form', - 'file': 'form', - 'files': 'form', - }, - 'collection_format_map': { - 'files': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.upload_file_with_required_file_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', - 'operation_id': 'upload_file_with_required_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'required_file', - 'additional_metadata', - ], - 'required': [ - 'pet_id', - 'required_file', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'required_file': - (file_type,), - 'additional_metadata': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'required_file': 'requiredFile', - 'additional_metadata': 'additionalMetadata', - }, - 'location_map': { - 'pet_id': 'path', - 'required_file': 'form', - 'additional_metadata': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - - def add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/store_api.py b/samples/client/petstore/python-prior/petstore_api/api/store_api.py deleted file mode 100644 index d171adfb3a06..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/store_api.py +++ /dev/null @@ -1,560 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.order import Order - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.delete_order_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'delete_order', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (str,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_inventory_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (int,)},), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/store/inventory', - 'operation_id': 'get_inventory', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_order_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'get_order_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'order_id', - ] - }, - root_map={ - 'validations': { - ('order_id',): { - - 'inclusive_maximum': 5, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (int,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.place_order_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order', - 'operation_id': 'place_order', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Order,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api/user_api.py b/samples/client/petstore/python-prior/petstore_api/api/user_api.py deleted file mode 100644 index 5f3964342921..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api/user_api.py +++ /dev/null @@ -1,1083 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.user import User - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user', - 'operation_id': 'create_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (User,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.create_users_with_array_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithArray', - 'operation_id': 'create_users_with_array_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.create_users_with_list_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithList', - 'operation_id': 'create_users_with_list_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.delete_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'delete_user', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_user_by_name_endpoint = _Endpoint( - settings={ - 'response_type': (User,), - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'get_user_by_name', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.login_user_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/user/login', - 'operation_id': 'login_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'password', - ], - 'required': [ - 'username', - 'password', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'password': - (str,), - }, - 'attribute_map': { - 'username': 'username', - 'password': 'password', - }, - 'location_map': { - 'username': 'query', - 'password': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.logout_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/logout', - 'operation_id': 'logout_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.update_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'update_user', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'body', - ], - 'required': [ - 'username', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'body': - (User,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - - def create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.update_user_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior/petstore_api/api_client.py b/samples/client/petstore/python-prior/petstore_api/api_client.py deleted file mode 100644 index 3c9e7a5f68dd..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/api_client.py +++ /dev/null @@ -1,898 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField - - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException -from petstore_api.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return (return_data) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, list): - return [cls.sanitize_for_serialization(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(cls.sanitize_for_serialization(item) for item in obj) - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - 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'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = AnotherFakeApi() - api_instance.call_123_test_special_tags # this is an instance of the class Endpoint - api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.call_123_test_special_tags.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] - ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-prior/petstore_api/apis/__init__.py b/samples/client/petstore/python-prior/petstore_api/apis/__init__.py deleted file mode 100644 index 5ccd49eec8e0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/apis/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from petstore_api.api.another_fake_api import AnotherFakeApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-prior/petstore_api/configuration.py b/samples/client/petstore/python-prior/petstore_api/configuration.py deleted file mode 100644 index 06a3179ad375..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/configuration.py +++ /dev/null @@ -1,518 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://petstore.swagger.io:80/v2", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/client/petstore/python-prior/petstore_api/exceptions.py b/samples/client/petstore/python-prior/petstore_api/exceptions.py deleted file mode 100644 index d223cb4876ce..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/exceptions.py +++ /dev/null @@ -1,158 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/client/petstore/python-prior/petstore_api/model/__init__.py b/samples/client/petstore/python-prior/petstore_api/model/__init__.py deleted file mode 100644 index 027452f37a87..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# 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 petstore_api.models import ModelA, ModelB diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py deleted file mode 100644 index 2d0c78c0ae19..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesAnyType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py deleted file mode 100644 index 462219270afc..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesArray(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ([bool, date, datetime, dict, float, int, list, str, none_type],) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py deleted file mode 100644 index 7f3132131878..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesBoolean(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py deleted file mode 100644 index 451ef48c59b6..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'map_string': ({str: (str,)},), # noqa: E501 - 'map_number': ({str: (float,)},), # noqa: E501 - 'map_integer': ({str: (int,)},), # noqa: E501 - 'map_boolean': ({str: (bool,)},), # noqa: E501 - 'map_array_integer': ({str: ([int],)},), # noqa: E501 - 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)},), # noqa: E501 - 'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)},), # noqa: E501 - 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'anytype_2': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'anytype_3': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_string': 'map_string', # noqa: E501 - 'map_number': 'map_number', # noqa: E501 - 'map_integer': 'map_integer', # noqa: E501 - 'map_boolean': 'map_boolean', # noqa: E501 - 'map_array_integer': 'map_array_integer', # noqa: E501 - 'map_array_anytype': 'map_array_anytype', # noqa: E501 - 'map_map_string': 'map_map_string', # noqa: E501 - 'map_map_anytype': 'map_map_anytype', # noqa: E501 - 'anytype_1': 'anytype_1', # noqa: E501 - 'anytype_2': 'anytype_2', # noqa: E501 - 'anytype_3': 'anytype_3', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_string ({str: (str,)}): [optional] # noqa: E501 - map_number ({str: (float,)}): [optional] # noqa: E501 - map_integer ({str: (int,)}): [optional] # noqa: E501 - map_boolean ({str: (bool,)}): [optional] # noqa: E501 - map_array_integer ({str: ([int],)}): [optional] # noqa: E501 - map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 - map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 - anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_string ({str: (str,)}): [optional] # noqa: E501 - map_number ({str: (float,)}): [optional] # noqa: E501 - map_integer ({str: (int,)}): [optional] # noqa: E501 - map_boolean ({str: (bool,)}): [optional] # noqa: E501 - map_array_integer ({str: ([int],)}): [optional] # noqa: E501 - map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 - map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 - anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py deleted file mode 100644 index 880a80c1a868..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesInteger(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (int,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py deleted file mode 100644 index 79b1fc5e219f..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesNumber(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (float,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py deleted file mode 100644 index f7afe571d71b..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesObject(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py deleted file mode 100644 index c7dff4d382f4..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesString(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (str,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/animal.py b/samples/client/petstore/python-prior/petstore_api/model/animal.py deleted file mode 100644 index cc35f796ed49..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/animal.py +++ /dev/null @@ -1,287 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.cat import Cat - from petstore_api.model.dog import Dog - globals()['Cat'] = Cat - globals()['Dog'] = Dog - - -class Animal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Cat': Cat, - 'Dog': Dog, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/animal_farm.py b/samples/client/petstore/python-prior/petstore_api/model/animal_farm.py deleted file mode 100644 index 89062cff69cb..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/animal_farm.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class AnimalFarm(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([Animal],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior/petstore_api/model/api_response.py b/samples/client/petstore/python-prior/petstore_api/model/api_response.py deleted file mode 100644 index 5e21cdaf5988..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/api_response.py +++ /dev/null @@ -1,271 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ApiResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'code': (int,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'code': 'code', # noqa: E501 - 'type': 'type', # noqa: E501 - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py deleted file mode 100644 index 41e90e2ae966..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_array_number': ([[float]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py deleted file mode 100644 index 068dc80b1a90..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_number': ([float],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_number': 'ArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/array_test.py b/samples/client/petstore/python-prior/petstore_api/model/array_test.py deleted file mode 100644 index 119a5ad1fdd0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/array_test.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.read_only_first import ReadOnlyFirst - globals()['ReadOnlyFirst'] = ReadOnlyFirst - - -class ArrayTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_of_string': ([str],), # noqa: E501 - 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_of_string': 'array_of_string', # noqa: E501 - 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/capitalization.py b/samples/client/petstore/python-prior/petstore_api/model/capitalization.py deleted file mode 100644 index d57e30d2c85e..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/capitalization.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Capitalization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'small_camel': (str,), # noqa: E501 - 'capital_camel': (str,), # noqa: E501 - 'small_snake': (str,), # noqa: E501 - 'capital_snake': (str,), # noqa: E501 - 'sca_eth_flow_points': (str,), # noqa: E501 - 'att_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'small_camel': 'smallCamel', # noqa: E501 - 'capital_camel': 'CapitalCamel', # noqa: E501 - 'small_snake': 'small_Snake', # noqa: E501 - 'capital_snake': 'Capital_Snake', # noqa: E501 - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/cat.py b/samples/client/petstore/python-prior/petstore_api/model/cat.py deleted file mode 100644 index ee6854b119bc..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/cat.py +++ /dev/null @@ -1,333 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.cat_all_of import CatAllOf - globals()['Animal'] = Animal - globals()['CatAllOf'] = CatAllOf - - -class Cat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'declawed': (bool,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'declawed': 'declawed', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - CatAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py deleted file mode 100644 index f4e32d0b736a..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class CatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'declawed': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'declawed': 'declawed', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/category.py b/samples/client/petstore/python-prior/petstore_api/model/category.py deleted file mode 100644 index 21fb7bd65b51..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/category.py +++ /dev/null @@ -1,275 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Category(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'id': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'id': 'id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/child.py b/samples/client/petstore/python-prior/petstore_api/model/child.py deleted file mode 100644 index e612dd923a23..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child.py +++ /dev/null @@ -1,330 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_all_of import ChildAllOf - from petstore_api.model.parent import Parent - globals()['ChildAllOf'] = ChildAllOf - globals()['Parent'] = Parent - - -class Child(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'radio_waves': (bool,), # noqa: E501 - 'tele_vision': (bool,), # noqa: E501 - 'inter_net': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - 'tele_vision': 'teleVision', # noqa: E501 - 'inter_net': 'interNet', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Child - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Child - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildAllOf, - Parent, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_all_of.py deleted file mode 100644 index c54ff66da748..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'inter_net': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'inter_net': 'interNet', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_cat.py b/samples/client/petstore/python-prior/petstore_api/model/child_cat.py deleted file mode 100644 index 6d971fd192aa..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_cat.py +++ /dev/null @@ -1,329 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat_all_of import ChildCatAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCatAllOf'] = ChildCatAllOf - globals()['ParentPet'] = ParentPet - - -class ChildCat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildCatAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py deleted file mode 100644 index 92d2a18ab707..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildCatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_dog.py b/samples/client/petstore/python-prior/petstore_api/model/child_dog.py deleted file mode 100644 index b7b0c98c76b6..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_dog.py +++ /dev/null @@ -1,329 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_dog_all_of import ChildDogAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildDogAllOf'] = ChildDogAllOf - globals()['ParentPet'] = ParentPet - - -class ChildDog(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'bark': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'bark': 'bark', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildDog - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildDog - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildDogAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py deleted file mode 100644 index 20d3d434d95c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildDogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bark': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bark': 'bark', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildDogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildDogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_lizard.py b/samples/client/petstore/python-prior/petstore_api/model/child_lizard.py deleted file mode 100644 index 37de49d0b1ae..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_lizard.py +++ /dev/null @@ -1,329 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_lizard_all_of import ChildLizardAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildLizardAllOf'] = ChildLizardAllOf - globals()['ParentPet'] = ParentPet - - -class ChildLizard(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'loves_rocks': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'loves_rocks': 'lovesRocks', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildLizard - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildLizard - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildLizardAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py deleted file mode 100644 index 28705f2c41f4..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildLizardAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'loves_rocks': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'loves_rocks': 'lovesRocks', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildLizardAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildLizardAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/class_model.py b/samples/client/petstore/python-prior/petstore_api/model/class_model.py deleted file mode 100644 index cbbd0ff1e81c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/class_model.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ClassModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_class': '_class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/client.py b/samples/client/petstore/python-prior/petstore_api/model/client.py deleted file mode 100644 index 82c5a6ed6bb4..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/client.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Client(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'client': 'client', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/dog.py b/samples/client/petstore/python-prior/petstore_api/model/dog.py deleted file mode 100644 index 2a18fc5493ee..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/dog.py +++ /dev/null @@ -1,333 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.dog_all_of import DogAllOf - globals()['Animal'] = Animal - globals()['DogAllOf'] = DogAllOf - - -class Dog(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'breed': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'breed': 'breed', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - DogAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py deleted file mode 100644 index cbb9083244a2..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class DogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'breed': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'breed': 'breed', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py deleted file mode 100644 index 65b981ab7be3..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py +++ /dev/null @@ -1,275 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumArrays(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('just_symbol',): { - '>=': ">=", - '$': "$", - }, - ('array_enum',): { - 'FISH': "fish", - 'CRAB': "crab", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_symbol': (str,), # noqa: E501 - 'array_enum': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/enum_class.py b/samples/client/petstore/python-prior/petstore_api/model/enum_class.py deleted file mode 100644 index bf9b682bd05d..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/enum_class.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumClass(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior/petstore_api/model/enum_test.py b/samples/client/petstore/python-prior/petstore_api/model/enum_test.py deleted file mode 100644 index 8cef5c659c6c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/enum_test.py +++ /dev/null @@ -1,309 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_enum import StringEnum - globals()['StringEnum'] = StringEnum - - -class EnumTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('enum_string_required',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_integer',): { - '1': 1, - '-1': -1, - }, - ('enum_number',): { - '1.1': 1.1, - '-1.2': -1.2, - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'enum_string_required': (str,), # noqa: E501 - 'enum_string': (str,), # noqa: E501 - 'enum_integer': (int,), # noqa: E501 - 'enum_number': (float,), # noqa: E501 - 'string_enum': (StringEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'enum_string_required': 'enum_string_required', # noqa: E501 - 'enum_string': 'enum_string', # noqa: E501 - 'enum_integer': 'enum_integer', # noqa: E501 - 'enum_number': 'enum_number', # noqa: E501 - 'string_enum': 'stringEnum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/file.py b/samples/client/petstore/python-prior/petstore_api/model/file.py deleted file mode 100644 index 6d8d65f45752..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/file.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class File(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'source_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'source_uri': 'sourceURI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py deleted file mode 100644 index d8db617ffa80..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.file import File - globals()['File'] = File - - -class FileSchemaTestClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'file': (File,), # noqa: E501 - 'files': ([File],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'file': 'file', # noqa: E501 - 'files': 'files', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/format_test.py b/samples/client/petstore/python-prior/petstore_api/model/format_test.py deleted file mode 100644 index 64b7ce721d97..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/format_test.py +++ /dev/null @@ -1,358 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class FormatTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('byte',): { - 'regex': { - 'pattern': r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', # noqa: E501 - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - 'inclusive_maximum': 987.6, - 'inclusive_minimum': 54.3, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'^[a-z]+$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'number': (float,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'uuid': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'number': 'number', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'date': 'date', # noqa: E501 - 'password': 'password', # noqa: E501 - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'uuid': 'uuid', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/grandparent.py b/samples/client/petstore/python-prior/petstore_api/model/grandparent.py deleted file mode 100644 index 0650a4ef7e39..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/grandparent.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Grandparent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'radio_waves': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Grandparent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Grandparent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py deleted file mode 100644 index fa467e99b34c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py +++ /dev/null @@ -1,289 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.child_dog import ChildDog - from petstore_api.model.child_lizard import ChildLizard - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCat'] = ChildCat - globals()['ChildDog'] = ChildDog - globals()['ChildLizard'] = ChildLizard - globals()['ParentPet'] = ParentPet - - -class GrandparentAnimal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ChildDog': ChildDog, - 'ChildLizard': ChildLizard, - 'ParentPet': ParentPet, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py deleted file mode 100644 index 1ccc67be07a1..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class HasOnlyReadOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'foo': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'foo': 'foo', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - 'foo', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/list.py b/samples/client/petstore/python-prior/petstore_api/model/list.py deleted file mode 100644 index 1dfa33efc320..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/list.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class List(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_123_list': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_123_list': '123-list', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/map_test.py b/samples/client/petstore/python-prior/petstore_api/model/map_test.py deleted file mode 100644 index eccf9c9e610c..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/map_test.py +++ /dev/null @@ -1,285 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_boolean_map import StringBooleanMap - globals()['StringBooleanMap'] = StringBooleanMap - - -class MapTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('map_of_enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_of_enum_string': ({str: (str,)},), # noqa: E501 - 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (StringBooleanMap,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', # noqa: E501 - 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 - 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 4d825b8dd46d..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'uuid': (str,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (Animal,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'uuid': 'uuid', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'map': 'map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/model200_response.py b/samples/client/petstore/python-prior/petstore_api/model/model200_response.py deleted file mode 100644 index 9bebea2423fd..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/model200_response.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/model_200_response.py b/samples/client/petstore/python-prior/petstore_api/model/model_200_response.py deleted file mode 100644 index d2f97900d188..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/model_200_response.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model_200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/model_return.py b/samples/client/petstore/python-prior/petstore_api/model/model_return.py deleted file mode 100644 index f3bd5123dd74..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/model_return.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ModelReturn(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_return': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_return': 'return', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/name.py b/samples/client/petstore/python-prior/petstore_api/model/name.py deleted file mode 100644 index aec8c8b900cb..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/name.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Name(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - 'snake_case': (int,), # noqa: E501 - '_property': (str,), # noqa: E501 - '_123_number': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'snake_case': 'snake_case', # noqa: E501 - '_property': 'property', # noqa: E501 - '_123_number': '123Number', # noqa: E501 - } - - read_only_vars = { - 'snake_case', # noqa: E501 - '_123_number', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/number_only.py b/samples/client/petstore/python-prior/petstore_api/model/number_only.py deleted file mode 100644 index 7a586085d7c1..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_number': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_number': 'JustNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py deleted file mode 100644 index ba4e371b4ac0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py +++ /dev/null @@ -1,290 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberWithValidations(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('value',): { - 'inclusive_maximum': 2E+1, - 'inclusive_minimum': 1E+1, - }, - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (float,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py deleted file mode 100644 index 6058a6381fc0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.number_with_validations import NumberWithValidations - globals()['NumberWithValidations'] = NumberWithValidations - - -class ObjectModelWithRefProps(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'my_number': (NumberWithValidations,), # noqa: E501 - 'my_string': (str,), # noqa: E501 - 'my_boolean': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'my_number': 'my_number', # noqa: E501 - 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/order.py b/samples/client/petstore/python-prior/petstore_api/model/order.py deleted file mode 100644 index 98fe0b869760..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/order.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Order(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'pet_id': (int,), # noqa: E501 - 'quantity': (int,), # noqa: E501 - 'ship_date': (datetime,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'complete': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'pet_id': 'petId', # noqa: E501 - 'quantity': 'quantity', # noqa: E501 - 'ship_date': 'shipDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'complete': 'complete', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/parent.py b/samples/client/petstore/python-prior/petstore_api/model/parent.py deleted file mode 100644 index f610698d600d..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/parent.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.grandparent import Grandparent - from petstore_api.model.parent_all_of import ParentAllOf - globals()['Grandparent'] = Grandparent - globals()['ParentAllOf'] = ParentAllOf - - -class Parent(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'radio_waves': (bool,), # noqa: E501 - 'tele_vision': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - 'tele_vision': 'teleVision', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Parent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Parent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Grandparent, - ParentAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py deleted file mode 100644 index ed97f412dd9d..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ParentAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'tele_vision': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'tele_vision': 'teleVision', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/parent_pet.py b/samples/client/petstore/python-prior/petstore_api/model/parent_pet.py deleted file mode 100644 index 9889f4c7a5be..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/parent_pet.py +++ /dev/null @@ -1,332 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.child_dog import ChildDog - from petstore_api.model.child_lizard import ChildLizard - from petstore_api.model.grandparent_animal import GrandparentAnimal - globals()['ChildCat'] = ChildCat - globals()['ChildDog'] = ChildDog - globals()['ChildLizard'] = ChildLizard - globals()['GrandparentAnimal'] = GrandparentAnimal - - -class ParentPet(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ChildDog': ChildDog, - 'ChildLizard': ChildLizard, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - GrandparentAnimal, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/pet.py b/samples/client/petstore/python-prior/petstore_api/model/pet.py deleted file mode 100644 index 5eb4041e91d0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/pet.py +++ /dev/null @@ -1,304 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - globals()['Category'] = Category - globals()['Tag'] = Tag - - -class Pet(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'AVAILABLE': "available", - 'PENDING': "pending", - 'SOLD': "sold", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'photo_urls': ([str],), # noqa: E501 - 'id': (int,), # noqa: E501 - 'category': (Category,), # noqa: E501 - 'tags': ([Tag],), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 - 'id': 'id', # noqa: E501 - 'category': 'category', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/player.py b/samples/client/petstore/python-prior/petstore_api/model/player.py deleted file mode 100644 index 07894ecfa312..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/player.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Player(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'enemy_player': (Player,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'enemy_player': 'enemyPlayer', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Player - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enemy_player (Player): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Player - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enemy_player (Player): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/polygon.py b/samples/client/petstore/python-prior/petstore_api/model/polygon.py deleted file mode 100644 index abe7f5e5ae81..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/polygon.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon_all_of import PolygonAllOf - from petstore_api.model.shape import Shape - globals()['PolygonAllOf'] = PolygonAllOf - globals()['Shape'] = Shape - - -class Polygon(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Polygon - a model defined in OpenAPI - - Keyword Args: - type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Polygon - a model defined in OpenAPI - - Keyword Args: - type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - PolygonAllOf, - Shape, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py deleted file mode 100644 index e596e25616af..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py +++ /dev/null @@ -1,281 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class PolygonAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """PolygonAllOf - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """PolygonAllOf - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/read_only_first.py b/samples/client/petstore/python-prior/petstore_api/model/read_only_first.py deleted file mode 100644 index 965325c2864d..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/read_only_first.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ReadOnlyFirst(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'baz': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'baz': 'baz', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/shape.py b/samples/client/petstore/python-prior/petstore_api/model/shape.py deleted file mode 100644 index 6a52a82fef71..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/shape.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Shape(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/special_model_name.py b/samples/client/petstore/python-prior/petstore_api/model/special_model_name.py deleted file mode 100644 index 6044e5e10084..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/special_model_name.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SpecialModelName(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'special_property_name': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'special_property_name': '$special[property.name]', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/square.py b/samples/client/petstore/python-prior/petstore_api/model/square.py deleted file mode 100644 index dd8309f11df4..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/square.py +++ /dev/null @@ -1,335 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon import Polygon - from petstore_api.model.square_all_of import SquareAllOf - globals()['Polygon'] = Polygon - globals()['SquareAllOf'] = SquareAllOf - - -class Square(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SQUARE': "Square", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Square - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Square", must be one of ["Square", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Square") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Square - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Square", must be one of ["Square", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Square") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Polygon, - SquareAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/square_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/square_all_of.py deleted file mode 100644 index 414338a77858..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/square_all_of.py +++ /dev/null @@ -1,274 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SquareAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SQUARE': "Square", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SquareAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Square" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SquareAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Square" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py deleted file mode 100644 index 52b6f39964bd..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py +++ /dev/null @@ -1,259 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringBooleanMap(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/string_enum.py b/samples/client/petstore/python-prior/petstore_api/model/string_enum.py deleted file mode 100644 index 5b8b59620b16..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/string_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior/petstore_api/model/tag.py b/samples/client/petstore/python-prior/petstore_api/model/tag.py deleted file mode 100644 index 55fc128a7157..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/tag.py +++ /dev/null @@ -1,271 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Tag(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'full_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'full_name': 'fullName', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - full_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - full_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/triangle.py b/samples/client/petstore/python-prior/petstore_api/model/triangle.py deleted file mode 100644 index 3642426ffdd3..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/triangle.py +++ /dev/null @@ -1,335 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon import Polygon - from petstore_api.model.triangle_all_of import TriangleAllOf - globals()['Polygon'] = Polygon - globals()['TriangleAllOf'] = TriangleAllOf - - -class Triangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Triangle", must be one of ["Triangle", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Triangle") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Triangle", must be one of ["Triangle", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Triangle") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Polygon, - TriangleAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py deleted file mode 100644 index 0105c347d412..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py +++ /dev/null @@ -1,274 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TriangleAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TriangleAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Triangle" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TriangleAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Triangle" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py deleted file mode 100644 index bd2a0cc2ec79..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py +++ /dev/null @@ -1,309 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TypeHolderDefault(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'string_item': (str,), # noqa: E501 - 'number_item': (float,), # noqa: E501 - 'integer_item': (int,), # noqa: E501 - 'bool_item': (bool,), # noqa: E501 - 'array_item': ([int],), # noqa: E501 - 'date_item': (date,), # noqa: E501 - 'datetime_item': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string_item': 'string_item', # noqa: E501 - 'number_item': 'number_item', # noqa: E501 - 'integer_item': 'integer_item', # noqa: E501 - 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 - 'date_item': 'date_item', # noqa: E501 - 'datetime_item': 'datetime_item', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI - - Args: - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what" # noqa: E501 - number_item (float): defaults to 1.234 # noqa: E501 - integer_item (int): defaults to -2 # noqa: E501 - bool_item (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - date_item (date): [optional] # noqa: E501 - datetime_item (datetime): [optional] # noqa: E501 - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - bool_item = kwargs.get('bool_item', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI - - Args: - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what" # noqa: E501 - number_item (float): defaults to 1.234 # noqa: E501 - integer_item (int): defaults to -2 # noqa: E501 - bool_item (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - date_item (date): [optional] # noqa: E501 - datetime_item (datetime): [optional] # noqa: E501 - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - bool_item = kwargs.get('bool_item', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py deleted file mode 100644 index fd90c62f4fd4..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py +++ /dev/null @@ -1,308 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TypeHolderExample(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('string_item',): { - 'WHAT': "what", - }, - ('number_item',): { - '1.234': 1.234, - }, - ('integer_item',): { - '-2': -2, - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'string_item': (str,), # noqa: E501 - 'number_item': (float,), # noqa: E501 - 'integer_item': (int,), # noqa: E501 - 'bool_item': (bool,), # noqa: E501 - 'array_item': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string_item': 'string_item', # noqa: E501 - 'number_item': 'number_item', # noqa: E501 - 'integer_item': 'integer_item', # noqa: E501 - 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, bool_item, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI - - Args: - bool_item (bool): - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what", must be one of ["what", ] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI - - Args: - bool_item (bool): - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what", must be one of ["what", ] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/user.py b/samples/client/petstore/python-prior/petstore_api/model/user.py deleted file mode 100644 index 11f6290223f1..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/user.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'username': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'user_status': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'username': 'username', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'email': 'email', # noqa: E501 - 'password': 'password', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model/xml_item.py b/samples/client/petstore/python-prior/petstore_api/model/xml_item.py deleted file mode 100644 index c6b82273f5a8..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model/xml_item.py +++ /dev/null @@ -1,375 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class XmlItem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'attribute_string': (str,), # noqa: E501 - 'attribute_number': (float,), # noqa: E501 - 'attribute_integer': (int,), # noqa: E501 - 'attribute_boolean': (bool,), # noqa: E501 - 'wrapped_array': ([int],), # noqa: E501 - 'name_string': (str,), # noqa: E501 - 'name_number': (float,), # noqa: E501 - 'name_integer': (int,), # noqa: E501 - 'name_boolean': (bool,), # noqa: E501 - 'name_array': ([int],), # noqa: E501 - 'name_wrapped_array': ([int],), # noqa: E501 - 'prefix_string': (str,), # noqa: E501 - 'prefix_number': (float,), # noqa: E501 - 'prefix_integer': (int,), # noqa: E501 - 'prefix_boolean': (bool,), # noqa: E501 - 'prefix_array': ([int],), # noqa: E501 - 'prefix_wrapped_array': ([int],), # noqa: E501 - 'namespace_string': (str,), # noqa: E501 - 'namespace_number': (float,), # noqa: E501 - 'namespace_integer': (int,), # noqa: E501 - 'namespace_boolean': (bool,), # noqa: E501 - 'namespace_array': ([int],), # noqa: E501 - 'namespace_wrapped_array': ([int],), # noqa: E501 - 'prefix_ns_string': (str,), # noqa: E501 - 'prefix_ns_number': (float,), # noqa: E501 - 'prefix_ns_integer': (int,), # noqa: E501 - 'prefix_ns_boolean': (bool,), # noqa: E501 - 'prefix_ns_array': ([int],), # noqa: E501 - 'prefix_ns_wrapped_array': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'attribute_string': 'attribute_string', # noqa: E501 - 'attribute_number': 'attribute_number', # noqa: E501 - 'attribute_integer': 'attribute_integer', # noqa: E501 - 'attribute_boolean': 'attribute_boolean', # noqa: E501 - 'wrapped_array': 'wrapped_array', # noqa: E501 - 'name_string': 'name_string', # noqa: E501 - 'name_number': 'name_number', # noqa: E501 - 'name_integer': 'name_integer', # noqa: E501 - 'name_boolean': 'name_boolean', # noqa: E501 - 'name_array': 'name_array', # noqa: E501 - 'name_wrapped_array': 'name_wrapped_array', # noqa: E501 - 'prefix_string': 'prefix_string', # noqa: E501 - 'prefix_number': 'prefix_number', # noqa: E501 - 'prefix_integer': 'prefix_integer', # noqa: E501 - 'prefix_boolean': 'prefix_boolean', # noqa: E501 - 'prefix_array': 'prefix_array', # noqa: E501 - 'prefix_wrapped_array': 'prefix_wrapped_array', # noqa: E501 - 'namespace_string': 'namespace_string', # noqa: E501 - 'namespace_number': 'namespace_number', # noqa: E501 - 'namespace_integer': 'namespace_integer', # noqa: E501 - 'namespace_boolean': 'namespace_boolean', # noqa: E501 - 'namespace_array': 'namespace_array', # noqa: E501 - 'namespace_wrapped_array': 'namespace_wrapped_array', # noqa: E501 - 'prefix_ns_string': 'prefix_ns_string', # noqa: E501 - 'prefix_ns_number': 'prefix_ns_number', # noqa: E501 - 'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501 - 'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501 - 'prefix_ns_array': 'prefix_ns_array', # noqa: E501 - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """XmlItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - attribute_string (str): [optional] # noqa: E501 - attribute_number (float): [optional] # noqa: E501 - attribute_integer (int): [optional] # noqa: E501 - attribute_boolean (bool): [optional] # noqa: E501 - wrapped_array ([int]): [optional] # noqa: E501 - name_string (str): [optional] # noqa: E501 - name_number (float): [optional] # noqa: E501 - name_integer (int): [optional] # noqa: E501 - name_boolean (bool): [optional] # noqa: E501 - name_array ([int]): [optional] # noqa: E501 - name_wrapped_array ([int]): [optional] # noqa: E501 - prefix_string (str): [optional] # noqa: E501 - prefix_number (float): [optional] # noqa: E501 - prefix_integer (int): [optional] # noqa: E501 - prefix_boolean (bool): [optional] # noqa: E501 - prefix_array ([int]): [optional] # noqa: E501 - prefix_wrapped_array ([int]): [optional] # noqa: E501 - namespace_string (str): [optional] # noqa: E501 - namespace_number (float): [optional] # noqa: E501 - namespace_integer (int): [optional] # noqa: E501 - namespace_boolean (bool): [optional] # noqa: E501 - namespace_array ([int]): [optional] # noqa: E501 - namespace_wrapped_array ([int]): [optional] # noqa: E501 - prefix_ns_string (str): [optional] # noqa: E501 - prefix_ns_number (float): [optional] # noqa: E501 - prefix_ns_integer (int): [optional] # noqa: E501 - prefix_ns_boolean (bool): [optional] # noqa: E501 - prefix_ns_array ([int]): [optional] # noqa: E501 - prefix_ns_wrapped_array ([int]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """XmlItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - attribute_string (str): [optional] # noqa: E501 - attribute_number (float): [optional] # noqa: E501 - attribute_integer (int): [optional] # noqa: E501 - attribute_boolean (bool): [optional] # noqa: E501 - wrapped_array ([int]): [optional] # noqa: E501 - name_string (str): [optional] # noqa: E501 - name_number (float): [optional] # noqa: E501 - name_integer (int): [optional] # noqa: E501 - name_boolean (bool): [optional] # noqa: E501 - name_array ([int]): [optional] # noqa: E501 - name_wrapped_array ([int]): [optional] # noqa: E501 - prefix_string (str): [optional] # noqa: E501 - prefix_number (float): [optional] # noqa: E501 - prefix_integer (int): [optional] # noqa: E501 - prefix_boolean (bool): [optional] # noqa: E501 - prefix_array ([int]): [optional] # noqa: E501 - prefix_wrapped_array ([int]): [optional] # noqa: E501 - namespace_string (str): [optional] # noqa: E501 - namespace_number (float): [optional] # noqa: E501 - namespace_integer (int): [optional] # noqa: E501 - namespace_boolean (bool): [optional] # noqa: E501 - namespace_array ([int]): [optional] # noqa: E501 - namespace_wrapped_array ([int]): [optional] # noqa: E501 - prefix_ns_string (str): [optional] # noqa: E501 - prefix_ns_number (float): [optional] # noqa: E501 - prefix_ns_integer (int): [optional] # noqa: E501 - prefix_ns_boolean (bool): [optional] # noqa: E501 - prefix_ns_array ([int]): [optional] # noqa: E501 - prefix_ns_wrapped_array ([int]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior/petstore_api/model_utils.py b/samples/client/petstore/python-prior/petstore_api/model_utils.py deleted file mode 100644 index ab2d0087dfa0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/model_utils.py +++ /dev/null @@ -1,2058 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from petstore_api.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - 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 variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - 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 variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - 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: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - 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( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/samples/client/petstore/python-prior/petstore_api/models/__init__.py b/samples/client/petstore/python-prior/petstore_api/models/__init__.py deleted file mode 100644 index 2fd471f464e0..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/models/__init__.py +++ /dev/null @@ -1,81 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from petstore_api.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.model.additional_properties_array import AdditionalPropertiesArray -from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.model.additional_properties_object import AdditionalPropertiesObject -from petstore_api.model.additional_properties_string import AdditionalPropertiesString -from petstore_api.model.animal import Animal -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly -from petstore_api.model.array_test import ArrayTest -from petstore_api.model.capitalization import Capitalization -from petstore_api.model.cat import Cat -from petstore_api.model.cat_all_of import CatAllOf -from petstore_api.model.category import Category -from petstore_api.model.child import Child -from petstore_api.model.child_all_of import ChildAllOf -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.child_cat_all_of import ChildCatAllOf -from petstore_api.model.child_dog import ChildDog -from petstore_api.model.child_dog_all_of import ChildDogAllOf -from petstore_api.model.child_lizard import ChildLizard -from petstore_api.model.child_lizard_all_of import ChildLizardAllOf -from petstore_api.model.class_model import ClassModel -from petstore_api.model.client import Client -from petstore_api.model.dog import Dog -from petstore_api.model.dog_all_of import DogAllOf -from petstore_api.model.enum_arrays import EnumArrays -from petstore_api.model.enum_class import EnumClass -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.file import File -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.format_test import FormatTest -from petstore_api.model.grandparent import Grandparent -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api.model.has_only_read_only import HasOnlyReadOnly -from petstore_api.model.list import List -from petstore_api.model.map_test import MapTest -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.model.model200_response import Model200Response -from petstore_api.model.model_return import ModelReturn -from petstore_api.model.name import Name -from petstore_api.model.number_only import NumberOnly -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.order import Order -from petstore_api.model.parent import Parent -from petstore_api.model.parent_all_of import ParentAllOf -from petstore_api.model.parent_pet import ParentPet -from petstore_api.model.pet import Pet -from petstore_api.model.player import Player -from petstore_api.model.polygon import Polygon -from petstore_api.model.polygon_all_of import PolygonAllOf -from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api.model.shape import Shape -from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.square import Square -from petstore_api.model.square_all_of import SquareAllOf -from petstore_api.model.string_boolean_map import StringBooleanMap -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.tag import Tag -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_all_of import TriangleAllOf -from petstore_api.model.type_holder_default import TypeHolderDefault -from petstore_api.model.type_holder_example import TypeHolderExample -from petstore_api.model.user import User -from petstore_api.model.xml_item import XmlItem diff --git a/samples/client/petstore/python-prior/petstore_api/rest.py b/samples/client/petstore/python-prior/petstore_api/rest.py deleted file mode 100644 index b66d8497bad2..000000000000 --- a/samples/client/petstore/python-prior/petstore_api/rest.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re -import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment -import urllib3 -import ipaddress - -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/samples/client/petstore/python-prior/pom.xml b/samples/client/petstore/python-prior/pom.xml deleted file mode 100644 index f6178c5c09c8..000000000000 --- a/samples/client/petstore/python-prior/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonV2PetstoreClientTestsWithComposition - pom - 1.0-SNAPSHOT - Python OpenAPI Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test - - - - - - - - diff --git a/samples/client/petstore/python-prior/requirements.txt b/samples/client/petstore/python-prior/requirements.txt deleted file mode 100644 index 96947f60408f..000000000000 --- a/samples/client/petstore/python-prior/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python-prior/setup.cfg b/samples/client/petstore/python-prior/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/client/petstore/python-prior/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/client/petstore/python-prior/setup.py b/samples/client/petstore/python-prior/setup.py deleted file mode 100644 index c484eec94f36..000000000000 --- a/samples/client/petstore/python-prior/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.6", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/client/petstore/python-prior/test-requirements.txt b/samples/client/petstore/python-prior/test-requirements.txt deleted file mode 100644 index bb4f22bb7a6e..000000000000 --- a/samples/client/petstore/python-prior/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest-cov>=2.8.1 diff --git a/samples/client/petstore/python-prior/test/__init__.py b/samples/client/petstore/python-prior/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_any_type.py b/samples/client/petstore/python-prior/test/test_additional_properties_any_type.py deleted file mode 100644 index ce985f76ed9e..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_any_type.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType - - -class TestAdditionalPropertiesAnyType(unittest.TestCase): - """AdditionalPropertiesAnyType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesAnyType(self): - """Test AdditionalPropertiesAnyType""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesAnyType() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_array.py b/samples/client/petstore/python-prior/test/test_additional_properties_array.py deleted file mode 100644 index f63ca82f6c22..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_array.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_array import AdditionalPropertiesArray - - -class TestAdditionalPropertiesArray(unittest.TestCase): - """AdditionalPropertiesArray unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesArray(self): - """Test AdditionalPropertiesArray""" - # can make model without additional properties - model = AdditionalPropertiesArray() - - # can make one with additional properties - import datetime - some_val = [] - model = AdditionalPropertiesArray(some_key=some_val) - assert model['some_key'] == some_val - some_val = [True, datetime.date(1970,1,1), datetime.datetime(1970,1,1), {}, 3.1, 1, [], 'hello'] - model = AdditionalPropertiesArray(some_key=some_val) - assert model['some_key'] == some_val - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesArray(some_key='some string') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_boolean.py b/samples/client/petstore/python-prior/test/test_additional_properties_boolean.py deleted file mode 100644 index e5a13891c098..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_boolean.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean - - -class TestAdditionalPropertiesBoolean(unittest.TestCase): - """AdditionalPropertiesBoolean unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesBoolean(self): - """Test AdditionalPropertiesBoolean""" - # can make model without additional properties - model = AdditionalPropertiesBoolean() - - # can make one with additional properties - model = AdditionalPropertiesBoolean(some_key=True) - assert model['some_key'] == True - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesBoolean(some_key='True') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_class.py b/samples/client/petstore/python-prior/test/test_additional_properties_class.py deleted file mode 100644 index befc14455da2..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_class.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_integer.py b/samples/client/petstore/python-prior/test/test_additional_properties_integer.py deleted file mode 100644 index 0e08b8f87706..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_integer.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger - - -class TestAdditionalPropertiesInteger(unittest.TestCase): - """AdditionalPropertiesInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesInteger(self): - """Test AdditionalPropertiesInteger""" - # can make model without additional properties - model = AdditionalPropertiesInteger() - - # can make one with additional properties - model = AdditionalPropertiesInteger(some_key=3) - assert model['some_key'] == 3 - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesInteger(some_key=11.3) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_number.py b/samples/client/petstore/python-prior/test/test_additional_properties_number.py deleted file mode 100644 index 90f4429e989f..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_number.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber - - -class TestAdditionalPropertiesNumber(unittest.TestCase): - """AdditionalPropertiesNumber unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesNumber(self): - """Test AdditionalPropertiesNumber""" - # can make model without additional properties - model = AdditionalPropertiesNumber() - - # can make one with additional properties - model = AdditionalPropertiesNumber(some_key=11.3) - assert model['some_key'] == 11.3 - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesNumber(some_key=10) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_object.py b/samples/client/petstore/python-prior/test/test_additional_properties_object.py deleted file mode 100644 index ded4a8e8a124..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_object.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_object import AdditionalPropertiesObject - - -class TestAdditionalPropertiesObject(unittest.TestCase): - """AdditionalPropertiesObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesObject(self): - """Test AdditionalPropertiesObject""" - # can make model without additional properties - model = AdditionalPropertiesObject() - - # can make one with additional properties - some_val = {} - model = AdditionalPropertiesObject(some_key=some_val) - assert model['some_key'] == some_val - import datetime - some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'} - model = AdditionalPropertiesObject(some_key=some_val) - assert model['some_key'] == some_val - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesObject(some_key='some string') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_additional_properties_string.py b/samples/client/petstore/python-prior/test/test_additional_properties_string.py deleted file mode 100644 index cff2c31921fe..000000000000 --- a/samples/client/petstore/python-prior/test/test_additional_properties_string.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_string import AdditionalPropertiesString - - -class TestAdditionalPropertiesString(unittest.TestCase): - """AdditionalPropertiesString unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesString(self): - """Test AdditionalPropertiesString""" - # can make model without additional properties - model = AdditionalPropertiesString() - - # can make one with additional properties - model = AdditionalPropertiesString(some_key='some_val') - assert model['some_key'] == 'some_val' - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesString(some_key=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_animal.py b/samples/client/petstore/python-prior/test/test_animal.py deleted file mode 100644 index 958f303f13e3..000000000000 --- a/samples/client/petstore/python-prior/test/test_animal.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] -from petstore_api.model.animal import Animal - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_animal_farm.py b/samples/client/petstore/python-prior/test/test_animal_farm.py deleted file mode 100644 index 7117d42b430e..000000000000 --- a/samples/client/petstore/python-prior/test/test_animal_farm.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -from petstore_api.model.animal_farm import AnimalFarm - - -class TestAnimalFarm(unittest.TestCase): - """AnimalFarm unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimalFarm(self): - """Test AnimalFarm""" - # FIXME: construct object with mandatory attributes with example values - # model = AnimalFarm() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_another_fake_api.py b/samples/client/petstore/python-prior/test/test_another_fake_api.py deleted file mode 100644 index f79966a26961..000000000000 --- a/samples/client/petstore/python-prior/test/test_another_fake_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_call_123_test_special_tags(self): - """Test case for call_123_test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_api_response.py b/samples/client/petstore/python-prior/test/test_api_response.py deleted file mode 100644 index 9db92633f626..000000000000 --- a/samples/client/petstore/python-prior/test/test_api_response.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.api_response import ApiResponse - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py deleted file mode 100644 index 4980ad17afb5..000000000000 --- a/samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_array_of_number_only.py b/samples/client/petstore/python-prior/test/test_array_of_number_only.py deleted file mode 100644 index 479c537cada7..000000000000 --- a/samples/client/petstore/python-prior/test/test_array_of_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_array_test.py b/samples/client/petstore/python-prior/test/test_array_test.py deleted file mode 100644 index 2426b27b7e46..000000000000 --- a/samples/client/petstore/python-prior/test/test_array_test.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] -from petstore_api.model.array_test import ArrayTest - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_capitalization.py b/samples/client/petstore/python-prior/test/test_capitalization.py deleted file mode 100644 index 20d2649c01eb..000000000000 --- a/samples/client/petstore/python-prior/test/test_capitalization.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.capitalization import Capitalization - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_cat.py b/samples/client/petstore/python-prior/test/test_cat.py deleted file mode 100644 index 64b525aaf118..000000000000 --- a/samples/client/petstore/python-prior/test/test_cat.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] -from petstore_api.model.cat import Cat - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_cat_all_of.py b/samples/client/petstore/python-prior/test/test_cat_all_of.py deleted file mode 100644 index a5bb91ac864e..000000000000 --- a/samples/client/petstore/python-prior/test/test_cat_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.cat_all_of import CatAllOf - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_category.py b/samples/client/petstore/python-prior/test/test_category.py deleted file mode 100644 index 59b64e5924a8..000000000000 --- a/samples/client/petstore/python-prior/test/test_category.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.category import Category - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child.py b/samples/client/petstore/python-prior/test/test_child.py deleted file mode 100644 index dea4e6010967..000000000000 --- a/samples/client/petstore/python-prior/test/test_child.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_all_of -except ImportError: - child_all_of = sys.modules[ - 'petstore_api.model.child_all_of'] -try: - from petstore_api.model import parent -except ImportError: - parent = sys.modules[ - 'petstore_api.model.parent'] -from petstore_api.model.child import Child - - -class TestChild(unittest.TestCase): - """Child unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChild(self): - """Test Child""" - - # make an instance of Child, a composed schema model - radio_waves = True - tele_vision = True - inter_net = True - child = Child( - radio_waves=radio_waves, - tele_vision=tele_vision, - inter_net=inter_net - ) - - # check its properties - self.assertEqual(child.radio_waves, radio_waves) - self.assertEqual(child.tele_vision, tele_vision) - self.assertEqual(child.inter_net, inter_net) - # access them with keys - self.assertEqual(child['radio_waves'], radio_waves) - self.assertEqual(child['tele_vision'], tele_vision) - self.assertEqual(child['inter_net'], inter_net) - # access them with getattr - self.assertEqual(getattr(child, 'radio_waves'), radio_waves) - self.assertEqual(getattr(child, 'tele_vision'), tele_vision) - self.assertEqual(getattr(child, 'inter_net'), inter_net) - - # check the model's to_dict result - self.assertEqual( - child.to_dict(), - { - 'radio_waves': radio_waves, - 'tele_vision': tele_vision, - 'inter_net': inter_net, - } - ) - - # with hasattr - self.assertFalse(hasattr(child, 'invalid_variable')) - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(petstore_api.ApiAttributeError): - invalid_variable = child['invalid_variable'] - # with getattr - self.assertEqual(getattr(child, 'invalid_variable', 'some value'), 'some value') - - with self.assertRaises(petstore_api.ApiAttributeError): - invalid_variable = getattr(child, 'invalid_variable') - - # make sure that the ModelComposed class properties are correct - # model.composed_schemas() stores the anyOf/allOf/oneOf info - self.assertEqual( - child._composed_schemas, - { - 'anyOf': [], - 'allOf': [ - child_all_of.ChildAllOf, - parent.Parent, - ], - 'oneOf': [], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas() - for composed_instance in child._composed_instances: - if composed_instance.__class__ == parent.Parent: - parent_instance = composed_instance - elif composed_instance.__class__ == child_all_of.ChildAllOf: - child_allof_instance = composed_instance - self.assertEqual( - child._composed_instances, - [child_allof_instance, parent_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - child._var_name_to_model_instances, - { - 'radio_waves': [child, parent_instance], - 'tele_vision': [child, parent_instance], - 'inter_net': [child, child_allof_instance] - } - ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None - self.assertEqual( - child._additional_properties_model_instances, [child] - ) - - # setting a value that doesn't exist works - # with a key - child['invalid_variable'] = 'a' - assert child.invalid_variable == 'a' - # with setattr - setattr(child, 'invalid_variable', 'b') - assert child.invalid_variable == 'b' - - - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - child_allof_instance.inter_net = False - with self.assertRaises(petstore_api.ApiValueError): - inter_net = child.inter_net - - # including extra parameters works - child = Child( - radio_waves=radio_waves, - tele_vision=tele_vision, - inter_net=inter_net, - unknown_property='some value') - assert child.unknown_property == 'some value' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_all_of.py b/samples/client/petstore/python-prior/test/test_child_all_of.py deleted file mode 100644 index 96e479cf0796..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_all_of import ChildAllOf - - -class TestChildAllOf(unittest.TestCase): - """ChildAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildAllOf(self): - """Test ChildAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_cat.py b/samples/client/petstore/python-prior/test/test_child_cat.py deleted file mode 100644 index 34c085515a80..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_cat.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_cat import ChildCat - - -class TestChildCat(unittest.TestCase): - """ChildCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCat(self): - """Test ChildCat""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_cat_all_of.py b/samples/client/petstore/python-prior/test/test_child_cat_all_of.py deleted file mode 100644 index 2a7aab100fbf..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_cat_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat_all_of import ChildCatAllOf - - -class TestChildCatAllOf(unittest.TestCase): - """ChildCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCatAllOf(self): - """Test ChildCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_dog.py b/samples/client/petstore/python-prior/test/test_child_dog.py deleted file mode 100644 index dfb09213e40c..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_dog.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_dog_all_of -except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.model.child_dog_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_dog import ChildDog - - -class TestChildDog(unittest.TestCase): - """ChildDog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildDog(self): - """Test ChildDog""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildDog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_dog_all_of.py b/samples/client/petstore/python-prior/test/test_child_dog_all_of.py deleted file mode 100644 index ca75000c650e..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_dog_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_dog_all_of import ChildDogAllOf - - -class TestChildDogAllOf(unittest.TestCase): - """ChildDogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildDogAllOf(self): - """Test ChildDogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildDogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_lizard.py b/samples/client/petstore/python-prior/test/test_child_lizard.py deleted file mode 100644 index 975dc1612a9f..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_lizard.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_lizard_all_of -except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.model.child_lizard_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_lizard import ChildLizard - - -class TestChildLizard(unittest.TestCase): - """ChildLizard unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildLizard(self): - """Test ChildLizard""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildLizard() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_child_lizard_all_of.py b/samples/client/petstore/python-prior/test/test_child_lizard_all_of.py deleted file mode 100644 index 1b3bf4dba943..000000000000 --- a/samples/client/petstore/python-prior/test/test_child_lizard_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_lizard_all_of import ChildLizardAllOf - - -class TestChildLizardAllOf(unittest.TestCase): - """ChildLizardAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildLizardAllOf(self): - """Test ChildLizardAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildLizardAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_class_model.py b/samples/client/petstore/python-prior/test/test_class_model.py deleted file mode 100644 index 060df39e4b5e..000000000000 --- a/samples/client/petstore/python-prior/test/test_class_model.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.class_model import ClassModel - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_client.py b/samples/client/petstore/python-prior/test/test_client.py deleted file mode 100644 index ab5e3a80d377..000000000000 --- a/samples/client/petstore/python-prior/test/test_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.client import Client - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_dog.py b/samples/client/petstore/python-prior/test/test_dog.py deleted file mode 100644 index 5f6a38b929c6..000000000000 --- a/samples/client/petstore/python-prior/test/test_dog.py +++ /dev/null @@ -1,151 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] -from petstore_api.model.dog import Dog - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - - # make an instance of dog, a composed schema model - class_name = 'Dog' - color = 'white' - breed = 'Jack Russel Terrier' - dog = Dog( - class_name=class_name, - color=color, - breed=breed - ) - - # check its properties - self.assertEqual(dog.class_name, class_name) - self.assertEqual(dog.color, color) - self.assertEqual(dog.breed, breed) - # access them with keys - self.assertEqual(dog['class_name'], class_name) - self.assertEqual(dog['color'], color) - self.assertEqual(dog['breed'], breed) - # access them with getattr - self.assertEqual(getattr(dog, 'class_name'), class_name) - self.assertEqual(getattr(dog, 'color'), color) - self.assertEqual(getattr(dog, 'breed'), breed) - - # check the model's to_dict result - self.assertEqual( - dog.to_dict(), - { - 'class_name': class_name, - 'color': color, - 'breed': breed, - } - ) - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = dog['not_here_a'] - # with getattr - self.assertEqual(getattr(dog, 'not_here_a', 'some value'), 'some value') - - with self.assertRaises(AttributeError): - invalid_variable = getattr(dog, 'not_here_a') - - # make sure that the ModelComposed class properties are correct - # model.composed_schemas() stores the anyOf/allOf/oneOf info - self.assertEqual( - dog._composed_schemas, - { - 'anyOf': [], - 'allOf': [ - animal.Animal, - dog_all_of.DogAllOf, - ], - 'oneOf': [], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas() - for composed_instance in dog._composed_instances: - if composed_instance.__class__ == animal.Animal: - animal_instance = composed_instance - elif composed_instance.__class__ == dog_all_of.DogAllOf: - dog_allof_instance = composed_instance - self.assertEqual( - dog._composed_instances, - [animal_instance, dog_allof_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - dog._var_name_to_model_instances, - { - 'breed': [dog, dog_allof_instance], - 'class_name': [dog, animal_instance], - 'color': [dog, animal_instance] - } - ) - # model._additional_properties_model_instances stores a list of - # models which have the property additional_properties_type != None - self.assertEqual( - dog._additional_properties_model_instances, [dog] - ) - - # setting a value that doesn't exist works - dog['invalid_variable'] = 'a' - assert dog.invalid_variable == 'a' - - # with setattr - setattr(dog, 'invalid_variable', 'b') - assert dog.invalid_variable == 'b' - - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - dog_allof_instance.breed = 'Golden Retriever' - with self.assertRaises(petstore_api.ApiValueError): - breed = dog.breed - - # including extra parameters works - dog = Dog( - class_name=class_name, - color=color, - breed=breed, - unknown_property='some value' - ) - assert dog.unknown_property == 'some value' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_dog_all_of.py b/samples/client/petstore/python-prior/test/test_dog_all_of.py deleted file mode 100644 index 7ab4e8ae79d8..000000000000 --- a/samples/client/petstore/python-prior/test/test_dog_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.dog_all_of import DogAllOf - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_enum_arrays.py b/samples/client/petstore/python-prior/test/test_enum_arrays.py deleted file mode 100644 index 64ad5fd7dc08..000000000000 --- a/samples/client/petstore/python-prior/test/test_enum_arrays.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_arrays import EnumArrays - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_enumarrays_init(self): - # - # Check various combinations of valid values. - # - fish_or_crab = EnumArrays(just_symbol=">=") - self.assertEqual(fish_or_crab.just_symbol, ">=") - # if optional property is unset we raise an exception - with self.assertRaises(petstore_api.ApiAttributeError) as exc: - self.assertEqual(fish_or_crab.array_enum, None) - - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, ">=") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - - # - # Check if setting invalid values fails - # - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab = EnumArrays(just_symbol="<=") - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"]) - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"]) - - - def test_enumarrays_setter(self): - - # - # Check various combinations of valid values - # - fish_or_crab = EnumArrays() - - fish_or_crab.just_symbol = ">=" - self.assertEqual(fish_or_crab.just_symbol, ">=") - - fish_or_crab.just_symbol = "$" - self.assertEqual(fish_or_crab.just_symbol, "$") - - fish_or_crab.array_enum = [] - self.assertEqual(fish_or_crab.array_enum, []) - - fish_or_crab.array_enum = ["fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab.array_enum = ["fish", "fish", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) - - fish_or_crab.array_enum = ["crab"] - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - fish_or_crab.array_enum = ["crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) - - fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) - - # - # Check if setting invalid values fails - # - fish_or_crab = EnumArrays() - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.just_symbol = "!=" - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab.just_symbol = ["fish"] - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.array_enum = ["cat"] - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.array_enum = ["fish", "crab", "dog"] - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab.array_enum = "fish" - - - def test_todict(self): - # - # Check if dictionary serialization works - # - dollar_fish_crab_dict = { - 'just_symbol': "$", - 'array_enum': ["fish", "crab"] - } - - dollar_fish_crab = EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) - - # - # Sanity check for different arrays - # - dollar_crab_fish_dict = { - 'just_symbol': "$", - 'array_enum': ["crab", "fish"] - } - - dollar_fish_crab = EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) - - - def test_equals(self): - # - # Check if object comparison works - # - fish1 = EnumArrays(just_symbol="$", array_enum=["fish"]) - fish2 = EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish1, fish2) - - fish = EnumArrays(just_symbol="$", array_enum=["fish"]) - crab = EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertNotEqual(fish, crab) - - dollar = EnumArrays(just_symbol="$") - greater = EnumArrays(just_symbol=">=") - self.assertNotEqual(dollar, greater) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_enum_class.py b/samples/client/petstore/python-prior/test/test_enum_class.py deleted file mode 100644 index f910231c9d02..000000000000 --- a/samples/client/petstore/python-prior/test/test_enum_class.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_class import EnumClass - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_enum_test.py b/samples/client/petstore/python-prior/test/test_enum_test.py deleted file mode 100644 index 7b4c1b6b66ac..000000000000 --- a/samples/client/petstore/python-prior/test/test_enum_test.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] -from petstore_api.model.enum_test import EnumTest - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_fake_api.py b/samples/client/petstore/python-prior/test/test_fake_api.py deleted file mode 100644 index d5ea58566103..000000000000 --- a/samples/client/petstore/python-prior/test/test_fake_api.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_xml_item(self): - """Test case for create_xml_item - - creates an XmlItem # noqa: E501 - """ - pass - - def test_boolean(self): - """Test case for boolean - - """ - endpoint = self.api.boolean_endpoint - assert endpoint.openapi_types['body'] == (bool,) - assert endpoint.settings['response_type'] == (bool,) - - def test_string(self): - """Test case for string - - """ - endpoint = self.api.string_endpoint - assert endpoint.openapi_types['body'] == (str,) - assert endpoint.settings['response_type'] == (str,) - - def test_object_model_with_ref_props(self): - """Test case for object_model_with_ref_props - - """ - from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props_endpoint - assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) - assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) - - def test_string_enum(self): - """Test case for string_enum - - """ - from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint - assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) - assert endpoint.settings['response_type'] == (string_enum.StringEnum,) - - def test_array_model(self): - """Test case for array_model - - """ - from petstore_api.model import animal_farm - endpoint = self.api.array_model_endpoint - assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) - assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) - - def test_number_with_validations(self): - """Test case for number_with_validations - - """ - from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint - assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) - assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_enums_length_one(self): - """Test case for test_endpoint_enums_length_one - - """ - # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one_endpoint - import six - if six.PY3: - from unittest.mock import patch - else: - from mock import patch - with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - self.api.test_endpoint_enums_length_one() - call_with_http_info.assert_called_with( - _check_input_type=True, - _check_return_type=True, - _content_type=None, - _host_index=None, - _preload_content=True, - _request_timeout=None, - _return_http_data_only=True, - _spec_property_naming=False, - _request_auths=None, - async_req=False, - header_number=1.234, - path_integer=34, - path_string='hello', - query_integer=3, - query_string='brillig' - ) - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters_endpoint - assert endpoint.validations[('number',)] == { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - } - # make sure that an exception is thrown on an invalid value - keyword_args = dict( - number=544, # invalid - double=100, - pattern_without_delimiter="abc", - byte='sample string' - ) - with self.assertRaises(petstore_api.ApiValueError): - self.api.test_endpoint_parameters(**keyword_args) - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters_endpoint - assert endpoint.allowed_values[('enum_query_string',)] == { - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - } - # make sure that an exception is thrown on an invalid value - keyword_args = dict(enum_query_string="bad value") - with self.assertRaises(petstore_api.ApiValueError): - self.api.test_enum_parameters(**keyword_args) - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py deleted file mode 100644 index cf77b62fab70..000000000000 --- a/samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index 1ade31405a62..000000000000 --- a/samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_file.py b/samples/client/petstore/python-prior/test/test_file.py deleted file mode 100644 index 8d60f64e01cc..000000000000 --- a/samples/client/petstore/python-prior/test/test_file.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.file import File - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_file_schema_test_class.py b/samples/client/petstore/python-prior/test/test_file_schema_test_class.py deleted file mode 100644 index 9a4f6d38dfef..000000000000 --- a/samples/client/petstore/python-prior/test/test_file_schema_test_class.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] -from petstore_api.model.file_schema_test_class import FileSchemaTestClass - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_format_test.py b/samples/client/petstore/python-prior/test/test_format_test.py deleted file mode 100644 index ca37b005fd96..000000000000 --- a/samples/client/petstore/python-prior/test/test_format_test.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.format_test import FormatTest - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - import datetime - self.required_named_args = dict( - number=40.1, - byte='what', - date=datetime.date(2019, 3, 23), - password='rainbowtable' - ) - - def test_integer(self): - var_name = 'integer' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_int32(self): - var_name = 'int32' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_number(self): - var_name = 'number' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_float(self): - var_name = 'float' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_double(self): - var_name = 'double' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_password(self): - var_name = 'password' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('max_length', 1), ('min_length', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = 'a'*(validations[key] + adder) - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = 'a'*validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - 'a'*validations[key]) - - def test_string(self): - var_name = 'string' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', ''] - for value_invalid in values_invalid: - # invalid values throw exceptions - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = value_invalid - FormatTest(**keyword_args) - - # valid value works - value_valid = 'abcdz' - keyword_args[var_name] = value_valid - assert getattr(FormatTest(**keyword_args), var_name) == value_valid - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_grandparent.py b/samples/client/petstore/python-prior/test/test_grandparent.py deleted file mode 100644 index 2972d01161cd..000000000000 --- a/samples/client/petstore/python-prior/test/test_grandparent.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.grandparent import Grandparent - - -class TestGrandparent(unittest.TestCase): - """Grandparent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGrandparent(self): - """Test Grandparent""" - # FIXME: construct object with mandatory attributes with example values - # model = Grandparent() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_grandparent_animal.py b/samples/client/petstore/python-prior/test/test_grandparent_animal.py deleted file mode 100644 index cabe4d81f98e..000000000000 --- a/samples/client/petstore/python-prior/test/test_grandparent_animal.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.grandparent_animal import GrandparentAnimal - - -class TestGrandparentAnimal(unittest.TestCase): - """GrandparentAnimal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGrandparentAnimal(self): - """Test GrandparentAnimal""" - # FIXME: construct object with mandatory attributes with example values - # model = GrandparentAnimal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_has_only_read_only.py b/samples/client/petstore/python-prior/test/test_has_only_read_only.py deleted file mode 100644 index 9ebd7683b398..000000000000 --- a/samples/client/petstore/python-prior/test/test_has_only_read_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.has_only_read_only import HasOnlyReadOnly - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_list.py b/samples/client/petstore/python-prior/test/test_list.py deleted file mode 100644 index 52156adfed2e..000000000000 --- a/samples/client/petstore/python-prior/test/test_list.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.list import List - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_map_test.py b/samples/client/petstore/python-prior/test/test_map_test.py deleted file mode 100644 index 3feda0f688df..000000000000 --- a/samples/client/petstore/python-prior/test/test_map_test.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] -from petstore_api.model.map_test import MapTest - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_maptest_init(self): - # - # Test MapTest construction with valid values - # - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test = MapTest(map_of_enum_string=up_or_low_dict) - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings) - - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - - # - # Make sure that the init fails for invalid enum values - # - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - with self.assertRaises(petstore_api.ApiValueError): - MapTest(map_of_enum_string=black_or_white_dict) - - def test_maptest_setter(self): - # - # Check with some valid values - # - map_enum_test = MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test.map_of_enum_string = up_or_low_dict - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - # - # Check if the setter fails for invalid enum values - # - map_enum_test = MapTest() - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - with self.assertRaises(petstore_api.ApiValueError): - map_enum_test.map_of_enum_string = black_or_white_dict - - def test_todict(self): - # - # Check dictionary serialization - # - map_enum_test = MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - indirect_map = string_boolean_map.StringBooleanMap(**{ - 'option1': True - }) - direct_map = { - 'option2': False - } - map_enum_test.map_of_enum_string = up_or_low_dict - map_enum_test.map_map_of_string = map_of_map_of_strings - map_enum_test.indirect_map = indirect_map - map_enum_test.direct_map = direct_map - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - self.assertEqual(map_enum_test.indirect_map, indirect_map) - self.assertEqual(map_enum_test.direct_map, direct_map) - - expected_dict = { - 'map_of_enum_string': up_or_low_dict, - 'map_map_of_string': map_of_map_of_strings, - 'indirect_map': indirect_map.to_dict(), - 'direct_map': direct_map - } - - self.assertEqual(map_enum_test.to_dict(), expected_dict) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 4dcb5ad4268c..000000000000 --- a/samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_model200_response.py b/samples/client/petstore/python-prior/test/test_model200_response.py deleted file mode 100644 index 4012eaae3362..000000000000 --- a/samples/client/petstore/python-prior/test/test_model200_response.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.model200_response import Model200Response - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_model_200_response.py b/samples/client/petstore/python-prior/test/test_model_200_response.py deleted file mode 100644 index 5858658d2947..000000000000 --- a/samples/client/petstore/python-prior/test/test_model_200_response.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.model_200_response import Model_200Response - - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel_200Response(self): - """Test Model_200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model_200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_model_return.py b/samples/client/petstore/python-prior/test/test_model_return.py deleted file mode 100644 index 54c98b33cd66..000000000000 --- a/samples/client/petstore/python-prior/test/test_model_return.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.model_return import ModelReturn - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_name.py b/samples/client/petstore/python-prior/test/test_name.py deleted file mode 100644 index 6a9be99d1a57..000000000000 --- a/samples/client/petstore/python-prior/test/test_name.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.name import Name - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_number_only.py b/samples/client/petstore/python-prior/test/test_number_only.py deleted file mode 100644 index 07aab1d78af7..000000000000 --- a/samples/client/petstore/python-prior/test/test_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.number_only import NumberOnly - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_number_with_validations.py b/samples/client/petstore/python-prior/test/test_number_with_validations.py deleted file mode 100644 index 3f0b78835d4b..000000000000 --- a/samples/client/petstore/python-prior/test/test_number_with_validations.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations - - -class TestNumberWithValidations(unittest.TestCase): - """NumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberWithValidations(self): - """Test NumberWithValidations""" - valid_values = [10.0, 15.0, 20.0] - for valid_value in valid_values: - model = NumberWithValidations(valid_value) - assert model.value == valid_value - - invalid_values = [9.0, 21.0] - for invalid_value in invalid_values: - with self.assertRaises(petstore_api.ApiValueError): - NumberWithValidations(invalid_value) - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py deleted file mode 100644 index 35bd3b6d8ec7..000000000000 --- a/samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectModelWithRefProps(self): - """Test ObjectModelWithRefProps""" - from petstore_api.model.number_with_validations import NumberWithValidations - self.assertEqual( - ObjectModelWithRefProps.openapi_types, - { - 'my_number': (NumberWithValidations,), - 'my_string': (str,), - 'my_boolean': (bool,), - } - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_order.py b/samples/client/petstore/python-prior/test/test_order.py deleted file mode 100644 index ee6988e28ccd..000000000000 --- a/samples/client/petstore/python-prior/test/test_order.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.order import Order - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - order = Order() - order.status = "placed" - self.assertEqual("placed", order.status) - with self.assertRaises(petstore_api.ApiValueError): - order.status = "invalid" - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_parent.py b/samples/client/petstore/python-prior/test/test_parent.py deleted file mode 100644 index 20282dfb41ea..000000000000 --- a/samples/client/petstore/python-prior/test/test_parent.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import grandparent -except ImportError: - grandparent = sys.modules[ - 'petstore_api.model.grandparent'] -try: - from petstore_api.model import parent_all_of -except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.model.parent_all_of'] -from petstore_api.model.parent import Parent - - -class TestParent(unittest.TestCase): - """Parent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParent(self): - """Test Parent""" - # FIXME: construct object with mandatory attributes with example values - # model = Parent() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_parent_all_of.py b/samples/client/petstore/python-prior/test/test_parent_all_of.py deleted file mode 100644 index ca87189bba50..000000000000 --- a/samples/client/petstore/python-prior/test/test_parent_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.parent_all_of import ParentAllOf - - -class TestParentAllOf(unittest.TestCase): - """ParentAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentAllOf(self): - """Test ParentAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ParentAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_parent_pet.py b/samples/client/petstore/python-prior/test/test_parent_pet.py deleted file mode 100644 index 17a4d60e75dc..000000000000 --- a/samples/client/petstore/python-prior/test/test_parent_pet.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] -from petstore_api.model.parent_pet import ParentPet - - -class TestParentPet(unittest.TestCase): - """ParentPet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentPet(self): - """Test ParentPet""" - # FIXME: construct object with mandatory attributes with example values - # model = ParentPet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_pet.py b/samples/client/petstore/python-prior/test/test_pet.py deleted file mode 100644 index b072cff5e9ad..000000000000 --- a/samples/client/petstore/python-prior/test/test_pet.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.models import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] -from petstore_api.model.pet import Pet - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_to_str(self): - pet = Pet(name="test name", photo_urls=["string"]) - pet.id = 1 - pet.status = "available" - cate = category.Category() - cate.id = 1 - cate.name = "dog" - pet.category = cate - tag1 = tag.Tag() - tag1.id = 1 - pet.tags = [tag1] - - data = ("{'category': {'id': 1, 'name': 'dog'},\n" - " 'id': 1,\n" - " 'name': 'test name',\n" - " 'photo_urls': ['string'],\n" - " 'status': 'available',\n" - " 'tags': [{'id': 1}]}") - self.assertEqual(data, pet.to_str()) - - def test_equal(self): - pet1 = Pet(name="test name", photo_urls=["string"]) - pet1.id = 1 - pet1.status = "available" - cate1 = category.Category() - cate1.id = 1 - cate1.name = "dog" - tag1 = tag.Tag() - tag1.id = 1 - pet1.tags = [tag1] - - pet2 = Pet(name="test name", photo_urls=["string"]) - pet2.id = 1 - pet2.status = "available" - cate2 = category.Category() - cate2.id = 1 - cate2.name = "dog" - tag2 = tag.Tag() - tag2.id = 1 - pet2.tags = [tag2] - - self.assertTrue(pet1 == pet2) - - # reset pet1 tags to empty array so that object comparison returns false - pet1.tags = [] - self.assertFalse(pet1 == pet2) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_pet_api.py b/samples/client/petstore/python-prior/test/test_pet_api.py deleted file mode 100644 index 091b30cf8ac0..000000000000 --- a/samples/client/petstore/python-prior/test/test_pet_api.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - def test_upload_file_with_required_file(self): - """Test case for upload_file_with_required_file - - uploads an image (required) # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_player.py b/samples/client/petstore/python-prior/test/test_player.py deleted file mode 100644 index ee7b95a677f1..000000000000 --- a/samples/client/petstore/python-prior/test/test_player.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.player import Player - - -class TestPlayer(unittest.TestCase): - """Player unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPlayer(self): - """Test Player""" - # we can make a player without an enemy_player property - jane = Player(name="Jane") - # we can make a player with an enemy_player - sally = Player(name="Sally", enemy_player=jane) - # we can make a player with an inline enemy_player - jim = Player( - name="Jim", - enemy_player=Player(name="Sam") - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_polygon.py b/samples/client/petstore/python-prior/test/test_polygon.py deleted file mode 100644 index 44c6f5430a57..000000000000 --- a/samples/client/petstore/python-prior/test/test_polygon.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon_all_of import PolygonAllOf -from petstore_api.model.shape import Shape -globals()['PolygonAllOf'] = PolygonAllOf -globals()['Shape'] = Shape -from petstore_api.model.polygon import Polygon - - -class TestPolygon(unittest.TestCase): - """Polygon unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPolygon(self): - """Test Polygon""" - # FIXME: construct object with mandatory attributes with example values - # model = Polygon() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_polygon_all_of.py b/samples/client/petstore/python-prior/test/test_polygon_all_of.py deleted file mode 100644 index fb04385d7134..000000000000 --- a/samples/client/petstore/python-prior/test/test_polygon_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon_all_of import PolygonAllOf - - -class TestPolygonAllOf(unittest.TestCase): - """PolygonAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPolygonAllOf(self): - """Test PolygonAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = PolygonAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_read_only_first.py b/samples/client/petstore/python-prior/test/test_read_only_first.py deleted file mode 100644 index c2dcde240e77..000000000000 --- a/samples/client/petstore/python-prior/test/test_read_only_first.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.read_only_first import ReadOnlyFirst - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_shape.py b/samples/client/petstore/python-prior/test/test_shape.py deleted file mode 100644 index 7e1c0659eaa2..000000000000 --- a/samples/client/petstore/python-prior/test/test_shape.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape import Shape - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testShape(self): - """Test Shape""" - # FIXME: construct object with mandatory attributes with example values - # model = Shape() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_special_model_name.py b/samples/client/petstore/python-prior/test/test_special_model_name.py deleted file mode 100644 index 6124525f5170..000000000000 --- a/samples/client/petstore/python-prior/test/test_special_model_name.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.special_model_name import SpecialModelName - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_square.py b/samples/client/petstore/python-prior/test/test_square.py deleted file mode 100644 index 056c248d6a90..000000000000 --- a/samples/client/petstore/python-prior/test/test_square.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon import Polygon -from petstore_api.model.square_all_of import SquareAllOf -globals()['Polygon'] = Polygon -globals()['SquareAllOf'] = SquareAllOf -from petstore_api.model.square import Square - - -class TestSquare(unittest.TestCase): - """Square unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSquare(self): - """Test Square""" - # FIXME: construct object with mandatory attributes with example values - # model = Square() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_square_all_of.py b/samples/client/petstore/python-prior/test/test_square_all_of.py deleted file mode 100644 index 466d3acbc144..000000000000 --- a/samples/client/petstore/python-prior/test/test_square_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.square_all_of import SquareAllOf - - -class TestSquareAllOf(unittest.TestCase): - """SquareAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSquareAllOf(self): - """Test SquareAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = SquareAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_store_api.py b/samples/client/petstore/python-prior/test/test_store_api.py deleted file mode 100644 index 0d9cc3dd36ea..000000000000 --- a/samples/client/petstore/python-prior/test/test_store_api.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_string_boolean_map.py b/samples/client/petstore/python-prior/test/test_string_boolean_map.py deleted file mode 100644 index e2e9d8b420b8..000000000000 --- a/samples/client/petstore/python-prior/test/test_string_boolean_map.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.string_boolean_map import StringBooleanMap - - -class TestStringBooleanMap(unittest.TestCase): - """StringBooleanMap unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringBooleanMap(self): - """Test StringBooleanMap""" - # FIXME: construct object with mandatory attributes with example values - # model = StringBooleanMap() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_string_enum.py b/samples/client/petstore/python-prior/test/test_string_enum.py deleted file mode 100644 index 5eed0ad6f0e9..000000000000 --- a/samples/client/petstore/python-prior/test/test_string_enum.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum - - -class TestStringEnum(unittest.TestCase): - """StringEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringEnum(self): - """Test StringEnum""" - - """Test OuterEnum""" - # make sure that we can access its allowed_values - assert StringEnum.allowed_values[('value',)] == { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered" - } - # make sure that an exception is thrown on an invalid value - with self.assertRaises(petstore_api.ApiValueError): - StringEnum('bad_value') - # make sure valid value works - valid_value = StringEnum.allowed_values[('value',)]['PLACED'] - assert valid_value == StringEnum(valid_value).value - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_tag.py b/samples/client/petstore/python-prior/test/test_tag.py deleted file mode 100644 index 68a3b9046bf4..000000000000 --- a/samples/client/petstore/python-prior/test/test_tag.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_triangle.py b/samples/client/petstore/python-prior/test/test_triangle.py deleted file mode 100644 index 433e572edddc..000000000000 --- a/samples/client/petstore/python-prior/test/test_triangle.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon import Polygon -from petstore_api.model.triangle_all_of import TriangleAllOf -globals()['Polygon'] = Polygon -globals()['TriangleAllOf'] = TriangleAllOf -from petstore_api.model.triangle import Triangle - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangle(self): - """Test Triangle""" - # FIXME: construct object with mandatory attributes with example values - # model = Triangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_triangle_all_of.py b/samples/client/petstore/python-prior/test/test_triangle_all_of.py deleted file mode 100644 index 322d2e802eb8..000000000000 --- a/samples/client/petstore/python-prior/test/test_triangle_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.triangle_all_of import TriangleAllOf - - -class TestTriangleAllOf(unittest.TestCase): - """TriangleAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangleAllOf(self): - """Test TriangleAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = TriangleAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_type_holder_default.py b/samples/client/petstore/python-prior/test/test_type_holder_default.py deleted file mode 100644 index f9c050b81a82..000000000000 --- a/samples/client/petstore/python-prior/test/test_type_holder_default.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.type_holder_default import TypeHolderDefault - - -class TestTypeHolderDefault(unittest.TestCase): - """TypeHolderDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderDefault(self): - """Test TypeHolderDefault""" - # required_vars are set to None now until swagger-parser/swagger-core fixes - # https://github.com/swagger-api/swagger-parser/issues/971 - array_item = [1, 2, 3] - model = TypeHolderDefault(array_item=array_item) - self.assertEqual(model.string_item, 'what') - self.assertEqual(model.bool_item, True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_type_holder_example.py b/samples/client/petstore/python-prior/test/test_type_holder_example.py deleted file mode 100644 index e1ee7c368628..000000000000 --- a/samples/client/petstore/python-prior/test/test_type_holder_example.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.type_holder_example import TypeHolderExample - - -class TestTypeHolderExample(unittest.TestCase): - """TypeHolderExample unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderExample(self): - """Test TypeHolderExample""" - # FIXME: construct object with mandatory attributes with example values - # model = TypeHolderExample() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_user.py b/samples/client/petstore/python-prior/test/test_user.py deleted file mode 100644 index 7241bb589c52..000000000000 --- a/samples/client/petstore/python-prior/test/test_user.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.user import User - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_user_api.py b/samples/client/petstore/python-prior/test/test_user_api.py deleted file mode 100644 index df306da07761..000000000000 --- a/samples/client/petstore/python-prior/test/test_user_api.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test/test_xml_item.py b/samples/client/petstore/python-prior/test/test_xml_item.py deleted file mode 100644 index 4354664815ff..000000000000 --- a/samples/client/petstore/python-prior/test/test_xml_item.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.xml_item import XmlItem - - -class TestXmlItem(unittest.TestCase): - """XmlItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testXmlItem(self): - """Test XmlItem""" - # FIXME: construct object with mandatory attributes with example values - # model = XmlItem() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/test_python.sh b/samples/client/petstore/python-prior/test_python.sh deleted file mode 100644 index f617f3adfa64..000000000000 --- a/samples/client/petstore/python-prior/test_python.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-prior/testfiles/1px_pic1.png b/samples/client/petstore/python-prior/testfiles/1px_pic1.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/client/petstore/python-prior/testfiles/1px_pic2.png b/samples/client/petstore/python-prior/testfiles/1px_pic2.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/client/petstore/python-prior/testfiles/foo.png b/samples/client/petstore/python-prior/testfiles/foo.png deleted file mode 100644 index a9b12cf5927ac757b054dd875ee137c2581f69bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z005plNklH1~87DdzFiA2XC;)~Dpo$3~298uzpt7UB?2C zrfPXaKqE40ylK3PysV@&`KFt0-oA3>N*fHwwj}%@A;B=D*V-^3rG!ZW76I^B9@-KC zfcx*if9)N2+};ZUfyS`GYGUP72QH^lJR<@ck#YP(vYDU1^7d=5z4ouR`v4F@Nabc& zLb)YG`lepJdcUe)d-l2K zyx+EMn+;9f>WF|wWYl=$JooJLs~>;-@g90(3kED$Fc@GP91I35VIa{AEG{nY zvw8F8{&{(Mcg&voQcL&x*|~mgF?k;cfR2d?c;u0XX7umh|K6qw9ud%pj2d_(Fkkrl z^Q#~K)3hGaAP9>gNm&_?3=;$k765@>@hSL4`-^bt>E}Z6H3S6PF%3arOT{xPiShm6 zaxDJ-3;f^iRX9|27?PB=Az0cLiU1Kio9=(PpI&~}St%btePp1vO#Y+2CJ+e36c-ow z&igcf^8ESphpk+>(vvzC9(RfzfDl4>fP?Mdh4VZjMxQ=?@Y-vywQ1HodVd5oBIA^^ zFc$o0{(`%wOdh5;vMIIOAz^?JV2PCI({a~1SD@c%=Q-O+LO>I}064#sRB;W90D~nC z1diaTZ~u!W`@d9i4~rm70kQ(H1R$V-r(^)1e){R~xW99MoJK8et3pD86hIgP!cuE2 zKw1>0Krj!2pkXD zN`p!8YmOYQIAhVG#V^j7F=NEeojV=tKz%-WTnrHe3^M%2asWp7z(xoa!_mMqWY}Q5 z@WOLZP03Y>fJS6gd+L6-_xm2_pMU;s6QUk=Pew6SD!BD)K3<5G%vs zW(dGyhG_$b*Vor%uQKZ(#&3EJo6C2BC`tuPL10!XU6PE15$%lxEZWaYWH42V~ z%W51sawPu46(2nC!V5DeuUfUr0|vqe6yahO!71WUOT=$!_^lEzkVw4#`s-7&`ex2( zDrwpXXhcR>5|ULVTV`ct9Vp(p8wN`N0u~s8C0H;7n|R>dff#&d5BszgAjyyhfye?| zYQuzl7P)~zA_7|h`vew{U=RzGR~^8_jq|YOz#g^Pm=O>vK0-vWq{Oh{Lr&;~mQtD< z3pb7U```aQck$xIA)8(O?s859!zQC~h}EG3!l5onD0uj-5)tzFj^gdjP1CGs3hPBg zwoGIYQNZul!~D%}esf^w&Yd8@zhMM{Nnl``R9w@x2ZZ*~*#ZkvR)Hm8k{Jw4%Ds_* z$;x%nd=55+a{@C-w2E$p7t_Yzyp|mh04W{_)JaW}5k&$^-dv1j%iet=9QcJBrKP3G zul;AAe59n;S34~t9~ zEFtZ)M?n3~5bAM~AwIo!RWy%-1cL(r1VNGnlYn7akOrf)GJxAQ&c()qdl3bxh+xv? zaY%!)Y15{}xVTn3!@D6c3)dBnm^yXpTpiH#S_q-mffd$D2+fFub3>?FYa?6$H8k5| zVdw7RsG0_FBcKr(jRr8Ps;XKhCwDra;|SXI(3ZxzE!tvE>Wye+Hiv+O1rubSqJm)u zHPtID5FKFRN=ia@b~e(|(~y#! zgcdDZf{1YF;32GDy&A8)@(<+Z=K6xDLb%4hBDVp{-p#q8d-v|IHFlM2|6Oo1IyP(V1Ssp;!)20KQ?e5i*8j_nrMUbJow|Mb<(Fq%ef3rM zT5Or~=FR)pZ>Rijgg5(9jZ0RIWf080a9^L4l!UCl*|_40ez>StFLdb8p~m0ir8%$Q zfj>@lVkTY?)1R4<(Hn~vzd;fAq?Uk#nayq6wq3mR?VM-+^rt`d(B|T?qTEA=4n?=L z)U~~O^_r8GmiA_ReC&>s1*}um%GkDT$Hm#1SsxoP5CB6EIjm121AjelIQpJ`E+7mD zutOKG+iO#F^S^BSFXrzoK!AkJ>|)2lVP;I6I1#gE&GN(&T+j=(7*K6MGI;%DW@h4+ zTW-e1mt2gvxY(2WE+a>b#;2ctis0;tdmR#+wros{i;LSC0gdAX4c|s)m|MTy*6;f3 zuYb3=xHtqLye40GlQMK63>h*6Lx&EX(Y0&Ww-b{S@(jZWoNDFEHJ^Bx_Q8kD-kDWJ zMQXhoAV&{_h;i}hoiU@!wTgd1isBhulvWqRkN^vbl0X&4teb;f6+bH1#dc4ES)=Nn zxhJ`l0hO7N(#_Z~g#`-zGc7F*lP6EY)%~xA5ViLmD=VweDdns%*I+}K0G@pEi8pV! zam?^Y%Jl@nLrQ7Re{I3sDO0A52uGChnvT_59De$4xZqS`Vj_O^t6#0XX2{@QCnY7U zG7O^vKb65S8C;c@SAY@Mj)Y0-gbuI-3;>c4XT;#0UgOcqXaxg=Dg+>4_}HFxJ_KQP z$u>;b@NeiWiw3UHf;aNT4lK*EfdeoM!}(jE^hAWDq$CU)GzjG3o9p zm^W{p&l>W&DoII6$X}Tk6^UsaCt&E**~1S$R6cw5oEUdv4IigJ=(W}OtRmqCJCGW%pz6&LRUNwtwIgJ4){{-&Nc2*b}z zM*!rcO9O@kaouO^m3yRsKrk@*s|EPryUk!hFkslOQ>gV2?1F@&cmqIob|$7x`xCl! z?OZR@U0GR)PAO*xU9@#n@B(vg8SW4%UnK3K<2K0_Q%PAOROTvIr z=K)aX8ttMsB7(&X3Bp6)yp5%M*MkN7;uqfHF@MZU-RIV=TVu+UDY*HTn;dthA;y+1 zU*WP#`*|ql{+P^=Aw%%O%;y_z7NyapT$$M%KK#0>mHDfJHoOcIyC5gJUcH8aKy}|S zT$N(@*h#3_n~{-$M<0FkhOVhy-aJ|$wJ`%mWo2c{yYHM-viPkfh^it~MiC54Sz{Im zL))d{(Q}5O3IUjGC}yZ&+sZKNOs=Axs0DCkz+^(1aj)pPvAZ~a)8lHsA7pI zC>Mi+NMKrjLogtSA&Fr~VFLo8W3xC6I`e$I_5C{KMhSwDminon0|ZsJf9tPr!yoRu zuU;}e$20o(?~i%&<~cs1TgRf-;J$tPQroo)FRmQ1G~j0=rX+Pb;GXnWSnEJ9?vW!$ z;?~TPKKR}5?wOLAo%Od9(Q=SdngNFEl8!k%lY-#Iv!Rzzy%FfRI zTLd(Yv2h-L@R0*EXU=RH4m8v$ul^n|U;tit@wpRP5S5jc`2346F?a53$on)GMMXtn z!5|#ZBm71TP3a~kCSua0NpFrCHR>0_q$5NWkW!jL2pPdY=Q(z4S26oO!(gmt6^ z3BZ5?UP%Bf2{sk5=!}U1#eg%{x^D^~F|Kef)|72iKxw}}vy$~%yQvVZ1U?b+UHhQ zR^q*P-^UwoEJ99BPDort|6LsyAUI|c3?NU({Rzv3&XR zX|rd~j`3O!p#bDh$5pTCV1xy3H|OWp#QTo40(0 z7oUF-IXO8fD=Tw0qBmx8H2no{;I{h0C?l-35Z;~e6WBsCMFK|?wylYKB3L+?2quZ& zcKSJf(XNj}A3r%u(jyj31h7DrZE5JaGoa|`OwzFylq;gZK}b_oz}oL&*_s>z2Kudf z8l`~>pExlDAuB5juP>b6s6k`eV~^vxXP@(}3&;9n#@6lIS~qJJRT=?}Fr%WPGXCsN zXO#r&E^3!VFS<>eH=Z>A|9D1Tem-W;d9SD^q0BN7_04_Q0T*R5pR2fw*00xr;Sh*rE?D!uR?EVa8 z)*%FlVY1=0JqQSi1A#;Mc>h=U=*O=yWBY$`ea8!MTgOY$(uh$ed_cLbV2RSe0en)j z6(8^W1||~%WI-CLX%n*mguwI9zvuyVMtpocva+%;e&Tp!^y$;!>DRM5b*g49DB#$< zdGj@m5i}ay(vVV`NeRhS-XKu0sTLa>i;bHK8%5e|_ny7@;~)NrWy_ZNz%5j(L4*WS zL*10>>CeX^r-jR&c*SCBYISH9sQ&$-^M+zj+f)#Hee9FW6dc@zsoyNc*N65w!A?(~ zM%6ckExVngzjQoSMB}Nh*CC@-3Ic}2t|R4`wfz%(T(TJ@fl845dTpJm=1r`$JQzXU z>izROYSbwF`7e*7S;J*m_9t{qIm1gP^isUT>73s3*kaOM4>0=!4h z=4kgwAR{Bg7gQvMPYfm)q?xPmPS4+v4R;7W?j(Cg63}RTUh!$H8?Zw1( zb5Uj;h5-|j7$ohWD+E{qAl0Ew3PV{6f&eQ37^+9CfQet9bt$$V*pD~9UkhP#OQbL$ zZ7R72IX}osUs_xTO9O`L0;d6U^ytx;KI5r6u{@-d*t>6^Q`o1oJTWbr?>|ye@kY-J zdX4v5hgzA;0wXCY2?eWi=_d&q!NB4D{kDm>^O7Y?>-EX!50Cwi$*nv=`wk7OChYZbh;9P z1p;I_>fc9QK=uYEX0V6`qYA`8nRNtXzIYjXj+B5{C@^3NDHzO3do*B3m{PTIguPMJ zdszSrFqx`tqivb!ir3(5QWOc5m9dX=gO!CAAj^rH=rVq3GhBtGl+&GlB(~LY>m9e_ zfj|D?m{#WUci+RJMQ9~`M$?V>Pi+c5TL5&Dx1wcf2vfBt;cKUf>CPnZj zvqpLudNUg!SRw$TC`|wQUHoU?Drb{ww@uZO7zh9u+O`|o$DEGDW^veAQHGsI%J9+t zEjVNyR)-3!7LFDPz&@ds-iHN2ges8J;viVo&o86kj|sWu_Uu>z(grRAgv`u7nE%Fn zA7EBiR^rL0ren#QOHfo)6iU7$Wx*)RMpfi0H_dS7NPrL^d!C%Wx2`ToxIQqFB!&zb zf~WubOzUtm4X0%GB=}2ufB*QyPwop2;CWBx)YQ}_1sM9;$B(-OWXxEqy1)o@d+YVTK`8cB6O8B(*45H8!eQ<-2k> zB!DPpSdy^&NGblaZ?&y94oGR)B`XACfeT}k@Zfm^(6L!-0K$oZ2uPH4x(rWmU4bQg z*8!%0B?++O5rPZ^m|++utbhe!5L$_5xb%#3aph^}qD#y6Xd4r+tP3d}>txfx-PnA1 zFV>W9$A5qP1_!MQ8)(Q0oT{h~BLIQ?+yYFR@>@JT{YhDnzfwH))O6(K^GZiTI6c9onE~+K&Nx1|=&+Ji+bg<3u(5EA->njZ$!qR<(n6)b(rBw$YSU?b? z5)x4mkR+5u094hir0N;FN^?X4LN&# zJ9gM{09)8bS|CFpwM9D++nEcNFvC#Yt2=inAR)+Y)V$@;UNp1QtChrvvfpQ7LKb4p zSk?3h5{C3!GJB5vh=;#^4~zgz))@r_0FoqHi{|*_c>{698C{g#CkPA+mI1qb-ph^w zBnT!HxlB>gl~}SA2I8Yy;GRyGq2C$Fn6mLLlv#&7@ew=bAq>D)izAzXs@5_fgq^M? z!<`C?%Pn1P);cVg0{N#8&JV#76!t~byK{(|e*ufNXCD8Lrf(I{>qHN9J8 zhu3xxbk}Z=UWS0Q{cRB-ToB(0x(-FxdDJA8tN0bFbs|Gz^^e6$K9K@SB8LIX=5X|B zmF%PyEwH1@!K5sLsb9a1vOp;Wn=0iB3&PHR#G5VfV%iPp+@d`s08=n5Ettfx30|S< zpfX7OLjePvu5cH{or78FH{!PS|G^LPAcP>rJMmOiyG^5%Yorgi#OT(zF#at3tj*cz z(d`J<8RBho9k&4l%9KA*QwcSBfG9CaCM&b)*b$eOHLrcCSK-JOopcotgzK zm0rT)#c$#FzyJNk$!8^hLa6_~J`G}NFtfRN^X4I5p1of|TA+Xb{*hf?%cHEU+@4>h z$W3;e!+;Q*nU527_i?((k4yaO&$w_lp;>sTZ0R-5BX#rA52qxTp_uVTRsfheTBnk<>;I79+~mz%bZmrIPD*SVFlS0Vy%3C{Ky< zDAa;9Y*|4DZcoU@g|TNTp=kT`H`%DA4WRbjd96BP(%JpgBc2qffQ0~Aut?yk&cm?y zqT4a~tSfPDtM)bl&O|^8r9%SOa$=G-`+U!R(4x)Egf7k7;pr~J5N9?AJZWK_y3Q|H zh0@Z}WbeK@GQ8QvBJ;Z&yd&1&DiePox{@{rPU=Gl2n7--)t7EvVZU?OVln&?ws z_ev2$C`}8tocFLu*y>smTMv8(iy4MZt`Z;!0AC&c4*BIfRCd8oj9_6Yle}}Q_86O- zrQ#))1vZ3gG;I^MYGVsn%wRGwNOzx;PF1oBnCjFpv(iJY!TwMTR@PP@1JV`C9(G0=;-X^QEDhYO*5Wr7 zPyR``Cjej=M)&GYvJ=sSh>V(zwQJXg5a8{i{XoNGHDh^ll31xcTLjL(CGL5{{0sOTNGXwB{J$Q&g8fxY;zcN@stGD7>EecF6kyP0oRIC+rsfypCqyYnjO^0@2Lg4}wA1Q;yjMYCDIq?8V02_*_N`i64Y3Hf72c$Nwu+4a_ z049xE5DAh2dy^{g6AWB-+PR2}ic#rj2@r(+{TQ1M?SZgm1^@|*$suP2q?^hOw%n=( zEs}~!YlBCnDQ)m2N3FfN8Dn?pRv=`s(m}Od{rKYv4b;Xk>v@p|Y(#G3i(iwfgNt}p ztHdU{#ka1<<14KGlDoSGG7 zS?I4O06-ABv}kA7_^bCM7`A07K}6Q^Souv3G&K4drV+<>!BDtpeI%w)HzPSY8M(Q+ zHYHgH;grG^NZA%{Nw+OVQG?nO!NS(FumhNaFs5BktoUIwzCQH5;&NCLWT=x{2SWe% z{Wl)vE%lfo0Tu$Co1fv4RIFQT3jl;=yJVIU0lMI{WUMaVsld=uaTI0?#g#u|){g%v znM5cO*m=#{;>N^Y7;;8;FruNFGgyjFev-z#rmI^*2|*eRB>^A^hSf0ZNYp1-c+jua z(Ha0<*z3Z`4zGjJty@=h(}nQ4CnbDD#TYEL7^N1>sbQcoKyHNtCp+I*^E?777pp5^TbwyCJ|r zxk?5M2x;NlLwoSZ=A{_3_El^-xZ84?LQ_#2Pk}Bi z+hbPx4QL@uuyF5j6#*azh5%c3z*6%! zoblj#3%2Rr+$rak6e za0@y&Z|l5Y6a(OZ!@Pv0$Xd!haLIo4(b-*-u!1v6jzpi0U{dHtO?J6HNq{6wsLgA@ zKmdf&z#&ZBFdv%_?gr@OgDym@=;L5Sk&3Taw%4eLaAegd8?-?{gNOpsk^x6Zl_-SZ zrJ0M7QM;pk`}U#2#ZoaGzdf)|=|Ttrk`@GN$hfoxdUgNRfNh;b!`*=Go1KP#pFb84 zpECsQo5!OH0RYO(Hv+2rnldcd(aSXL3`w1@N9i731_`^W7T6jnRW&6x<5Nh>(HfOd zO`l-PA_7vyZCI(2l~*0aL*Fc|oj5J&Iu`ZQgeL|h3DMEf2kN`pwL!>T3_cvJqv34` zw0!xyksV$~LBFJ=BwqkfX>tmD@WWnR=oqlAhv94nl1ihrKC)=Gh>nW61ng{)!2XI7NV{1z zNrq+E!-@zv6`;l ztXZ>zr+gq309v$YQ4-EK)+sMm7Nu1ciZ4KnDo90XK9o!~vmw;$#AixF)CM<$e!}C(n zC$+hM9Kj?hQ~=vH(D?ZHZ@oU7TXSN9nNVC@97(&@(YW>YTcHJxwaS$= z)M+|z?8oXN=bf;o^c%bA z&nDm5KtEx^Efq)GXQxykl!(6Zo^(3sr8FMYqT91)Ph^MJ!RXTYJjBPxyRi+DYGVt= ze|E3NkAXvq)MXb)DIeY|qo+(}#msb1YRzaA?AZ)<^%d&=8L!toyBS1ujdeVY>km}!;Eq^bv!|P~_88gP=MUdUP&|-;l zs{#*y^RCj?ly;YQNY%y6(D%!7^f*<4l}jJDgd5lWx>?OY?w~AM~fuS-MtzXEEpgJK(K^#dc*XNO?IBg zLc)+htZ0s2t&&tr0&;_^78vUf@3uKCyyN??@s>wG{c31!wn?5-$-H*ug_Fm&qF z>623)G(4u$hK!7iYJ+tEF!$g8iR|t=8u$MGcfN%yp~P}XTKMFLukg-yg-Rd?0+vnf z*PID5ge#B>Hz)@H7ORZ~OFA1tse&tT@q&<|OsjwI5tj%9q$t$V_Sa$IgOaaME)OX% zl6EUa-K*9xo$B0^wlqiuG)XcJScmZ84_`T13xln2&skei3^r^%4Uhf|133HKbKXB?LBkuI zv41ZdHELv4aG=Kv9EF92kTMe2sEZLD9fezOz16Yw45@eIf5iww{E@tlm(5DW=TXv zS=m_|l__g@OfPoa6=p`x(wxW+ucPtDseeFR>v%AP6CW^jX_&C^(B>Tc->%h)k6)j$NRrhKurGcoSc}1 zW>L`xPf5_IE(Mg7l=y}hAp8U`wO}53r1OjQa-sM z1(+C5Z~ZUEZFmi<4r~K)mCB$9R^?da61sGSsJ1X5RnwqK!78gF2~~!~rbD|hyXX^) zUjGl=_~k43&+a^w1rFNl#I0ntOnXh(r|N@WFU6KayCJ0I$OjrMYb_;fFmS*+gehAV z+106v=&Iv2BrQx#xfl|*FpsU`t~c<1cCSJ4ky1sB3rJYPRY&g~mtwmb9MHGJKLTKhDy%O578BRa#rTa2 z@YZ+hvFmUtm;_8q!09gUQ5I)bje)8l@zsIv@y>Va@aR|XVEC#RasAp?@j~&(*m7VG zED#K7!pX{z0l~uQccOGc0}w1wW*x$W4X-Snh!Btx1_5hIcH*gRE0nSrTaZzJuv7+x7`XKGb9^1s*e>f= zfFpdsr-R3enJV$|_uqnT?u&X)m)<{U@HM~Y2B=b3*V%x4h+A*Hm6yEvPSB%nO9N&? zQc?n@PW>Z(``h24w6xUs%-e3e4O1VuKeGEza@>8_WGq;)z|&rleLlAiIRUN|D2fs&&JdAG+d{=G3Tewz)%Cx7Dbzs0ifGijiXl1s* ztaRP`L`eWj4P4Svly7!Bx9fO=fJBu5qAfU5e6X#huMh3ULtEalc_D1OW3VeqZJ}Ql z00_O~k};q|8WN)7Q7RAPlkdL8;_ugjpF=t5*+TKIq9`H6soBf*XpL$M^7EHmJAA}oM{L$UVcZm~ON8;N zmTTdj#Kc4ttjvq-`dS#1?w*2q^X54l%Axo}k%@GNbxE#}kA990_7N-B!jMYy!L&=w zz4tRX;LWa>jIZUPPE+a*>tM?cvKp9@aw%?1=mVBf@DZh0cdl0(%LKWg0yiE&cI;s8 z&NZ01^AnU=6*f;qHGZ@N04o3~44X)$;w|p=s`ilTx)=r+0b;wKn?w{dm<1O1o`8g? z(~q$~EG1`10?|^U%2ZjRHKp4yzHlzI9FKRd{_uxCto`+!cbwl)Yo)>56971`bLWQ@ zAOynud$uN`w>Cw`JD3^C$;px3UQ6TYXQpHJ>{-xq`dVGvwAqaem1;FWcE3~gJk=yw zJzw`KVOB8>uiF{ydU`j3e%|QOqp@Pee=%s#Ap4MDSg5j1c-8aNf`u7dS76lVuVQuC zw+>@e0gvjJBBVO;Ez&(*0n1_#RCoI?%8D>?{l76|$Ga%w!wzU!Hd~e10-M4COQqi_ zz-)jh%I-p^tQ!M1<(`$$ux|1^>8yUo1PmQq_O?`_fC9A_Jrr~=paQ@(Lk9o4LE~W! z;ht#ggPF~Q4vAGlxQb5xQ^y4ejkubb$82HNteLoG@SwQF`tnBPl5fQ>XqBgRU9qi*NP6dLY)VQ)yq#NY$>B zCU;o^NQgcIV>{gJ{p}T9v zbSM2R6h&TGD#h$|wbXhIIIS0>U?RW)J4h+e|IBnedhS36T#n_Q=<{3Hm8@&Zw`1J; z|MQ*g`ZJS~l90bLFG}y9hUn*7FQ5_b%jw6S|N9H;{`99mrF-2D*Yx$|{e6|N0i>j) zATR&Zh@NO2jr_a<+;!L8o;n~;I|Ar>38gXW^eh!>GwbxN-Obh0(Mt{L z@A^%({cV^TS6?*%8`f=r6sj~`7iqIcCjW2}aqJH+{c9=o| zfp()n288WyX|6;SDglZ@TJ!ek5EF-we)tN2RIUfRaW+6vx&^t}4gqBqkLi$sdpcd| znhnROA5-9^0-uHys4^rbuA7V1<=YU&Y7Sj@knz-0PrZ4=jn@x9mg|2?#WaHd-nw;r zzn^9IU7`NX&({d{pp?I>2rjEve}?uQ+C_GE9gp3+_uz@YJc;Ew%j`h3@b}%drSddO zk^))*Ov}*;#KyKn-@bh@?Al?t?9xjR8yj2GwS&o%euvjyd(AfEEmt(h7Vxp`^d!iz z;|pq|McFMP?MhG;oU|)dO}j;;zHXBZ#Zom0y<4W>$!^yo)@+6ke)tMcZhH^kR~%6F zF0kD$Nw5sJBG&>VG5R!2I_GlqYkjU#?UEMYp^qOera^YIX;TQS*uMpnHoxJxJp%q7 z$J>jxH8%_+&`=%Y>lHMr0}p046FVkVc~3L9B9QEp%JKons8OTv^fS{VJG$OomvU?< z+<^Q~^H5k=h#$*J9bSeqpH%>}`vvEtWs4RVG-x2sKC2U=qoYsibLYJD3jXrclQ>j* zP!)pNG-`&WHax)>AJH2*N_BFwCHgE!Do+#8ba9xnBm{0tz8K>YG7!bls3eIfsD85_ zezzGP{`eI>E8l@#6(!DL7Hc*`ued~9envM8XqyH@3K*oi+1m{fj``iBt;Noyqyq-8 znS_wH|Ni&q*E~M$v7TN_!;NM5M_gPS zHf}16xFtWaaip>mH{S3I^9}sp1&wy=U#r#q1p) zD`qS!>O4GPSX^A(T$ohR(D$O=Y2@MlzUG>NcLi6v`T;{YLD9u;y%_wI8K|tR#JkJi!{7e)EY`1I z?@LU5bx>8`7w@G(Lb^MpJETFnk#3NdM!G>jx}>BVq`Mm_K{};FIt8TRZN9(vW}g2! zbBA;9Is5Fr)~A+y=vUndDj^{fK-#>1B?WC92zuyE5g~g`aS7_gTK)jYQBG-L-8+VU zT{xY5m{H@lOGA8yIn&bQ#I#ygNeI?lXDI8>NV~j@5va-JsY)S%@43tIQdrYxPkQ9! zrtcFHUbl%+5kTVy{Ft*_qvYpjs5PbRBg2b}>hS(&ygy|gH`Tk^aevm2XOtryOB#4{ zvp@#K4^cqJZCURyk0ufPva{OTv$*tpvmdq!V!HxH2gjXTHX#M=OtcD2xmT)kZO72z zrfxZE>}1HHCT}Xkn0*R}=-D|fPVcZ;Pi}@xH5ge?h-i&3q}+~I3E;%nt?s{fN_9BR z_vsMcjdXPyZ*8aLRLiUO!@|$iym3wTeez}JQkr)0lmkG=|A5P75``qD%M2jS?_D)+4Ltn-%%yzK) zvuHxbm>twYD^=W^GX7wjP7fr6Qna>FHCZ0lHI~ID?_LYwH=Eq#CG3YUnHRORS$c_{IkVtj&3X;W!{-|KO9L8#3SF^o$1N$wkRq*um zL@XS1U@BO5O?~QTYQfB3mF4B%S!ha`B}q$Fv~ej5-dZMo=TujCCnrkyGst7NO}xF~ zS{}#0I$h-O1D`Apb0>T>1a3()e8oyubW@sT(C%>8bfm{14n4yC1J?9VQO6;?>?({4 zAR`(5Fmo`*S|?&Vu2;RMmm{S7r>T#5I_}2(B{V(EW`^;7esK?tJrSVjz(vBMl>Ek$ zEfxCHXY|Kdb5c&*EySifo>yJSWP#sJ{oQYxQ%vYM_@AX{05|us6|5iOF;xE^yc2|| zr$&{!Ff^*&;!N|R6J4K^`n+#l9g-RqRo>U%FW_^Iyr9odDc)4C-u}G$cjzD{svatvZ_6Cb}FJs!bMv(djb; zrn9T~abG!JgM`4<4r#0JwFu&dC*N<<>a&0DA70_4nkEg47RoIx1mqWIO? zvKk+|jo&}YBSHyw?V2uEKWQ8Z{>?w2p@Lh_#YSh}+%k<%T~O5_e;=xkg<%35LVPNI z)g+v}h{iMNg%~l*+&+5^`YP271*Nk*2NSKXHnt1R!nLJT`G!(rJq-E+54x{ehbk;F z+-xZzfw`7$gQ+nc6D^W@dPKAKX?Aekp_BnF9Y*-_ovc5~kF#@{|4KvT!pkEFLRIup ztZn=NJhU~^kWIzF@M@*CD7U?RS*?5jPgJ+ozSqw-IzqO8$M?bwySI4QrLyr^>DzNz z3eB#Rq(1Ah@w3DPsL;eQ^kbExuQPgO16eBg*K4Q8#7;HoEW0tFr(kOsS=NX#|Z*Hnzoo1vM_RM@&^Nk5WcjQNh7M&a; z`Gwk7!bbyGJKh(C<+JnedTXKfb7b=vf*9o{CpD7>U1VT=b>&|5J?*l2UaPV{*r<)y zfn&5wrd|AVIhFjN_Gq*ms;Y|?UvO|PF3w-2rC5CoKUSW&dF-AXtPXv>pBcWn zY0!BS!BD57x4&||M)WN!tF@Y9r)0I3jz6mh<)UVg^l+mCR;xgAAGx5YND4y5L1?Cb zb-}2~?6Y;%Hgl&&jMlKi+<#;Sqo5iSS8XzKFKe>Up&N|V46E_Bm25Qm_X7{2L?C;~ zGla>Xm#*BU`{sNrhlX-Sm?P&q5`^vQNrc6!z-yum^iZ>$wtZQ&;c?R*p)QnHGYe z`sVm(>SLn&KGhj@XQWta%IgyI`q?%h&|y%Bh>*Sb6^faxtQY~}JuZBI6lARN(IJ>m zSeVrJ?lOjHWyq=|9&O!SJgjWh!xu{U!3qu&3oDaP8b?QNE2EG~T%YC$SKdu1eCi0@ z4ZH8Fa8lIMV^uHSVORIMP37A;ibyD!N;kjPmBX0g>)-`>=%Xi?K8q10NB^3U>deK_c2^3e-R8zz zKNoc}QG#T$W`AGms-U2-Pj6$r%yaH$SZgMW4`pI*{bOL@!}Jbnd=deHq6Hi0zoW%` z#n+H-g5vC$y}i8#NEY;D*Ad+lL3hXC{gXr26&kHl`>Y>wQ*8N@_ZVZH1-Pv7PkIDG z{-XE=_V04Jh1MeWx9I$vX%YkUJZ{h)uo89M?a-oKSPKF&d#PrF?4#sOq(ehLf8hKf9d{!dWUqa^zFS;>~dhihu9H8e<0F(%r#t(MBPs+s!~~ zt@{Q{W_7L=vAGJ6AV8>3wBffnA@j+?!a~A|jzekIX>Pc^c|Jslq}p+dfJJcw=z&{V zm&H~Jn4`gCR#Q<~-?M<#Ba{dZgh7x>)&$3GD!>V&FE3r_8i;IjyY3FkgnD%dT+Quf zV64JKRaI3rtFwy)Vh&kF947*X4#J{_N-Xr97ip$u$244AnP=4W^`jype%=@}=2wq;B zTIT10EQ2<0hD%QIQHDqFd$eOpMoJFKE&P1t?A5l*jYH;`=~&);G$^Logbg>$@uR@q(uLuCjG&H ziUvQ6&|Z^5*F&Jvvkemy!`a#SgP`VvER>Y1<}1$h1~kGRvZ5{-$1^D^GhllLR(U~P zaO2)irM`zJwnnm$0>AFB@ULtXqzkiuwyv5He(iI5wB zTnuAmU~ty=*7zb$x*pej(t22gHF@c{5s-hRvvvVgiJ^^lOPU#;JKywJT8^d$+uV*H zfGuW5tl~m%*NYH|BtZwkzC9<`e=Orxu#!OVO)c@u?c-ozWOO<`J?R6&?I50(rc5gF znZA!66Mai+iz12cZ1%l3pTE+rWfGE+b>)wV0+ay=zhhQf3mjh0qZ&TzceFxC_}#)@ zo-hgmdFdH2S{om?x(<#1>btu-%ww%@H>8$Af51GVNOD!RG{iw{LrvI$y& z#5r+~+oVGWYwhW4HZld()&`W9-7uSkK^sj}gigE-LZjuAa&f9->UsgX% z!A7`ZNpxvC2NWhQ!XV=Uo`VXM$_>-)7SdbwUAX4hJ_H735ur!tx@1vu+lbJx@_YkZ ziSLXYerfEHa#780T;1^c(I~!~$cPlivPhJQsvdFMyMb5^7s9@PyVCCh5F(-yav2ncidrss8az>N^_=qCzp$vh1m-7Z0> zs>vLV@xrr(M6!&TM5zDK+Vf|UGB#pH5O8zu{zc1Eqp%7&~kx z6b0DgDcIRDzJFg~^EflEw^_p#a6e(___I@Ue&8C41*^dl=@lzY>S-qB6~qxHuMjRSF5WDT-))xH34|O| zzJ`Q{BejwG-E2rpMd7m>An-y8rV%Hs~%9IH{PKaaO!9MYDxFC?vk>df$gf z1w{Bl#L){-0#INQH2xJ7C4UC+vG}V%(~d?Zg52kaU6D2ZxeI#&0o+){ba?b!08oTQ zMn;zZ9V$suH8hOLHuB_lJ6hPlp93y$WZZyn7{EWLW#~%)3?GUEQ`NkjVZpIG6@GUW z;ahM~j!whXIjYlin%6xqj&hNQv%a_9|BenjeGeNWdF_6?{F*A1H+4H%4qsob*s$6j z`LsItH{)99x#({%xU2uIrB~wkGK$KQx*r)fH$M|UZhmBRurFhtG z$Yu+RK7`Cr8qa0t+eT0Nc8M*O16eEH=Z8km@F3(um>l?t z`(|M(dyTR@@>Z+pIeOdLU$OmkEC-eRR;x`_-+*F>V$aXQ-rnBajfHdx==Zu-(?!3M zTRRcIetQQoUCZhank&EEEb5QMQ~s~qh-vG>mnw6--NGXN=XzIc&$^2vg{lQtrUWNh zLjx@*KT_lP1kGgBNle6BUe)9=^nVLzA&bg;2k;b9pMOI$jeFt&lQ{=R9S5aA6VzbA z@b$W=j;G>^6`Ooihq)jwQ^x#4mu{5%crasZRcut@Rst+EhsDMN+;bYc=|C6|p?WdF zU~G%jj0cf_FcOR2`Q9dJT@?G8>>;Et-=d^2@AhUC@>O&{mS&;Oos7S}>i&0{0F=g6>oepd& zt|%#j6Zh1@!fw)z<#~-?AORJ6P1o|Wa>9b1f44C}q{%;8x(3<;<|`Gs1^Y z?X%L_Kv<8q+&X15HTiM5-CW)bfwx<`*^wf382)yPf*P60=*iyn+3Prn+3j={l$_-$ zk!ZBZVL;2}7bOVA_)GZM`t*pfUih|-ki;k- zMEwAjBL!~a^Ig)a7#m;bS+9cN1vrUWDtE!_Y`+FGf~Q@D%bLqv4P`^4qdvmI z!hV*(B<*q1|(hL)D}4Ff|E9I{!n zZeZy)EQlt;z^^`O|*m}I$Adn#WeHY_^f7)rKYk1+gK5!!nTvEnmVT(lfi-Jw(id;=lHUUni+pq;uvTV8G%iKWb5uj z^6Adb_Vx>AMzj)L8s4z3C|0(XJ|-@RBW+`@lawk9NuHaK?!pGO~Wqr z5Lx$l&p#hc>~sO7JUh_1y$zfb?QsJhA7?Mkrt_-&Ja1(v4Et6%tzo1TnNV?Vl$Dh1 zs}ETi8G*OPtM8XYsg0JLAxa;c-8%W;@hj;N?S_vyp|8oFv>^VopV(iHV~4fQJe&DS zhvI^Q?M&dvKIH{Bm6}D^4G(b;4nIKgFDN^7?mxlxcD{C#2#3jF^@&e;VP3>b7!$$K(?H`SV+4me+`m z{qF0xF=yIsy7KD$K4nd-UI?R_C>YVkI~c2dEL2o5`BKqdoSXuO4sLI9ExZVOl*=n) zP5DGhXt6-kYw#OHVOe6jg}(3XIMGq7 zbTn}wFvRx}#i1J2icvg7oyl!7@SV6{4Dc~@Mfe;YUbxbNS6JF_;x$a_Jos2)n1&}`V**$a`7 zkW`K)&i1RjgzlMMymHY8JJE#P&=gfh&8~S08cgb(cDouy zxyfpo5KV%Ic%#5)Un_KUsrsh?G;j$Cw(p6QvcTj$s8)fe-bgjml^ZN({A-#XgH5|b z7#3tfsw?$4Vd_XL0R_M44hc!N+Sg!dfi4Fm-gs1Z325@=7O6*gHE_M;`?$#o9|klH$*12l z>kCEg1DQR!aA4mi z4`mK?c=HR>qA*VuHaVcWEQ@CUju1LEE-@p_|7lHR0=#q>{w0;@owb;jg&D__S@E4{ z=K&IihO2+*flEcjhy?9>Cz4E)VtZyoa1J!`K6@K>MCHwT*WT|2dA3&{##cKQYJ3Ie zD)kU3dvgL|K+Ezt=eE6zvks8-K|Gr-SO|bZ!RbkqFBM~joj1shuelMbI3L^muN4lI zPdteDY~;po#ooOOM5KnUhBAa^qb5g!hfRf%`v-|qosW$fg3L_bOy|dL-0o(-c9PbQ z!7^QnIj+ddi~2lhbE`Et$Zz4Fcn6DW!Gru)bJg#-Vg6|r^^LArpd|A7`MHduqN|dv z!-h6nE={d*tbiNE`01qDn@HL2I0!6-Xatt%QEVw=XW8X4BlH5~9kc>@F4K=mUVXBb z*RE_FcV=SW_v5!>Jdo#3+Mcg%{4df4#zcM(h|I0^#BwuS!$Lr@`cig(Q&P3a&Lca7)M<_(IA1V>EGFE$ff7cV0w|v-270>C>ZEg)f{(s zAK6eg{kzewEw`vr)~=b2TdpO`_S*U}LsWF&;ZS2%bXan1z4HwkbwC)oc2HrkS1U#+ zhfOYRD^h$e2la(f`tBZ^40JbU5Murp(t)T!{{TDD0AonGDFH4^=N=nr=PAVSP8wP8 zOd=y<7ZIzPSyFVp$Y?d#eN7Md+nz2VIBG@I*A2wwH0sQ|1I*j#2?z+R0CWfMeL91P z_>pRdLJ6CVi>RJ9pvG<~Ch|Z2m70c{^ywn|dAaY{oig?}o+RFK350m@Ks)*3_Y2Cp zqnJ+FA@z~3ey=j+M;|)A&?UKrg4)R|EKvnxlfdKYU;Fw)!8N=j-A2Wakgs{<1%K+G zL1`QN^XJbYiFwR!oA0s?w{6#}iXab0>YaYNj+)sk_*hdNQoSbo(`%3hAaZe2Kj`HV zNZ#zSTrr2dh9`;XBTfYbC%^-LI;f%bEC`J|_*S#Zki_hlEI!lOI@!;}ih-$Q9_l!= zLBFpkh)^=g=&(`5hT*XyjDv@fX-j{S?HjG0pB}GBGlX#lPfs6VmM=StlfICntA{@% zX&E^A=fg&)rE!nizIb!~`@Z|cbr;ULOg4ciaq@CA{xbsu0bLph42KvshTAqd1Y zjWQYzb~*$a9$@YFHge6PjDh`Comk$!PE2e|dvdNeVQQOzGiy=sWe0zRGpLRueMC_< zR=Z|Bhfzc90zwfOWTR{{9oYuH_6wqb?_1L4tYEBE(t_XVP>nM=>t&rfUJp{<>SD;xP5-7Mpt?q2hi-0-@wlvuF_Q_w#4;0wy0tZ~#ve6-dV%IQ-3Q=(kco&-(AD_tg9$0Z8YPl}fS zG5OjO{L!3Z2%-b~f!tr?lQ#KU$IO>^W*IjN9p149hXrWMDvGG#Kndl-FYxDcn))~1 z5^v10pF<-fZ5KP~4q3#u{BUh}PcbU10mUCXJnB2&w6xq}1g`25rszA@oRUI8!y|q@ ziR>F0e+&qYaif)xlf;07dB0HMV!)>TPmFWaqY(~d0+1rJv#{`Bj`RHl2^@W2$b5o9 z{K;#Jf$qRZC#iJKjD?KED5JG=BGH570?jy_O0>2A;1@-4cvo(vh~o40&#y^6tmhb+ zJAN=#86E!7Enywr1K=qLJ$kfwDYQXQ53S%?H`UkJIlPcXaW5|~>Le`zQ`dQx?;Sr! zUh{uq(hfR47(e_%(*3K8Kj38LsNoF~xtqjON(b3zb4Fd0r}Rk`zX&}SL`baQUzL39 zFnbgbVD{;(n~d!8k`I>xp+NUSN~OR4?3md?3gFRUAAX)EExVn&6+cWZ>T2^Co`Cf5ZdJf!RWwsK4in^({owwL zAgQ@F9Q}>V=Z3%Q|T^Rx36Gpu%X6X;IAsFcI&owqT zq^@&CnE;Ra0;=9(dk&imk|e8NZQS!`I5R=`ts!H6BhyzbH|2Jw@y*T6RdaJ1B+$OK zyfjfCr)ubLYBt_g{Rs+!_K^2WBCzBy(g8kr>aXwR!S-F{IL+$N`;Vj_{RjE?auiu; z1x#2NCYXrD{?LRuNJfGuEfz|6K>=+0^V&5!(Gmm4cWHv#TSj)D1xIBcWvDvAP?Mss z2(6-uWJQ3>>H+A2uV-|3juOG>5f4fmz`_75ssHVTQMK(N2f7|Pezmb>>jH#o9lH!k6H1j9rlyA3Y5deLvZiSn(@7TW z!sKxucYcV`oXqMGR`!#mX^al-{V&aSTZul~6RV)SSRT6En%6I9D&~T!zgN3by<^Sv}j)$;jWOx)uXJ8OgCT$ytS%U@y5a< zBKSROy<0Rzx2%fB&y#;^-t+byO$+3I1aXo|Rq!O4*M^q*`i$lJN&d^i^@*6?*T?U^ z{6n47H6}}R*7SzN*Dhz@;5)6n0m`5GH$`G*u=`$=3QgjF20*}*?*@3mi+}VF3Xsfv z-qgmWUAOV#g zWMTD;$|x(pV6BvN=4M=svRyT= zoMN#E27e(|#Dr*4+4Y#xLu0_bobwy6L5=v^(U(DJ`~}Nr_gnt)@mE(Houb%aF!c*h zzP-&Pt+NOvut4{s(JDM;iY{LsvZ@9jgq7z1tF5O_meu1`|ItW$tfzFv%RC9<&~b%! z_wTsv!$P%<=TajH9|@>4c-e|T5K6r zJ=J}&Pc-!XS9q5k)9P>t8t^fZI)n6vVqz;u_iBf?x4ws16{`VxF8Rd>;&(--dp$(5 z>Sh$dt7V`7#`#a->qV8nD(&|qr|*93Dt3%GM7J?mK6eHZZ}1F7EG}i-m3`(-d)jZG zr-q>&G-(zvuiaFTW8$N-`8L)8WVe)BRKiy%3IhSGP*H4$=koTt#pF-AOPD~sz|Z=m zuLIafz4pYSve{T_!G)fnsHz}9o|n0MNf&H^I7>*zbwfCsaSI(1DG3WCDM3L&OW9r@ z2QHIt;j(-;=G|wvYm8N(s4>5OJv$#Hd+9(}gjP={OAb;y&M_@`5CAu7-W!aBv$07O z6Bnzlo22W^(j1c4DD{52ZKIAmTk?f?$7XAPjOzHo+_c89x0J-CnyrWbN{UBApd{IYIx{y;$2l4qF$)#dGaxfDT z7RoyxpV_=)de!C8cqahJ2D0bV{JEDFlY52g?%Zz4P5`MYNpi|ssvr3fwP3@Wfnuk13olrTH4J; z%jZyG#qv7ccQM0XPkNSHJ_#Lu?cEzH;WGd|r|{i&-y8__7Qm0$QlCb%dLj0!x;ppB z#sx1%t1~70g>42#u7-w&y7T&x(`l{LrO___$sqA;1ktU1FGXdjS!*eK15GGRU~c|r zZ-ov9;pb0Zy7(sEiY}Z&e$?k%|K}(dO@X_#fw1`e_-pIV@dQM?_L)z2lXPUE4Qxs- zBG#&>T1K~nQ;T($gRltlBF_&O7fX#IpX|QEMz1^FoNaK@t_l6Q2axu?%G6;{@YeA? zUMrzf#nyRG#B(0lXyTKIH)9g>{{!}u#pJqQXb&aA2{JrPF^zAS?hiX?%gmBDV7p#n}u zLr8ax0{%|blG`u~8obp$(}8i()Wii)Io>y|9L#Qm*FrZ#({hYjH)u7E=Wvuk5;y=z zW!azkK21jlgL(D#puwhH$i##$?{cuV&Y^X`$U(D0_s^vOQkUafL>cj0!VOrZFno}v z=W&%?#nWQH>&m{|ia-F*h7L`=iZ9LP2s9>}E7!@71%X>_r=5B(Td789MqPd#U!N|= z%$v1|A%broS&;{U5sE{9G_M9)x}#7({LMPfmQxSx&a!`3;~Q@7S$LFJP*KK4lMb%h zO7?oWO&brFZ5&a5|2m_P@eqSFR4E;uTV=OEJnV8H0<>3w|A`1?UUj5jZCH5ihmDK- zVLNP6WbxMLsRa*B-|;D=4;jRYygi=}K_rqe#xp4$ELP6$bR11(r~3SQW<6U(X9CgE z+IFdNYjafin+Axe9cMdsySZ36S$hvJ`eSdp`1Q+8Vr5yK^m&QreTh`BXhPO_gQXvW z_2(w50Qn;AiqIcA?%1~LBT1=jCWZ8W+GXo~qmTQ#)@e~gqp44qQ6clO1VS8q0#n$X z?j7#YS|5!9Q$>V0j-^-VX!P?f?IiaG?=Sa1gJhji8n9+Od)Djx>^82NmYqlRwQ?5D zIyB{w`of$ee1i7dn%4XTPM)`XMUXC9bBqD9NrYz5wr;nMlJon(gr25I;fZhWEB-7=T>4YLUhZ96gWZ=%q4qUe&sqf5pY`E>}|LfR=dgtz(Z_TT07SE z;`23|`+2c9Pdy)xf(s+ zZ>>ut>t15VShNZ#i}+q@fWEv-oOMo0U^o9O z^b*#3nsYJWJp*OlU0ZtOiQSp1_y4eriNxJpLy+dY93*gWVO}-CO!S#%)Wuklbq9Q9 zCjAx;ky7vL`uU)WNMmgK)%L}wT_YcsgJ|B><`J@I^qADLq8Z>M^S8IQe!DZC9Sd}w zrhf~(0k!RR@NK%y4G2)yEPoL=_S}(Gb^45=S4^($6!~ zYqc1NMSeC~+W@s!43CUmai#R!ehETMw{Nv>!(~8Ax%MB%N|*Be^fNBg(4Kq>9ZJvY`W&NUPE$Ru|;fiK#%pC^haE$n_0H6 zw7G2!(-ki%rUJCwfN{=yFC0CR0AgrVe^v?dI=eFElC?5}K-fH3CDJcnt+$lb`?CxH zNIihcL^*8EYi4@Wv7aDT=-=*UilG-hZ7L>-59(^VAxTa_Vd2JD+v$&4t;crRn`1Cv zqQ~K+9oaK`2OcVqF&|OJ=WHWl3)iO8{>Pi`U0m3P^~--J8tcFU9PNZPK*5=>oR7+5 zV?FfUKjT#}#kw8#du49krn%*>j_Wn9hjV_ub$*S# znKO2g4YVo96F|ibu(5%X z_~Cdf2Yk!-0%Y5R!=onk?V*Z^o-~Y!$*$R58GM-G2G^h^W>5^hsCoF7ClhEWdTw z^Q;HqH5hl`ET2&M6hiG!a5nOs%E`gZeEh3b>FqwTho5~u^17V{~L6)YCgR-gtR8xD=@hm)Y{??5j10z3w#!u2sPftdQcmFQq^yKJp=H&DX z1=&a4<3p$^_Ab1}K&7wgs~NDc5DN8MF`dVBC$jFPeaWtN@IdCQr}uRHsna(135Y42 zt^&$V8nUrU#_a45x>Xq$zpl$7n)neyCm0`oDhcX`a#wO>4LrQ$}1AtS=9EXyYE}ms2J4{g}9g6c5;u z;XH5QuH?uW-)M(a8nk*syH5?{x1ffgYU2v%1OPZc^K3VoOk|FV76zZq=Ok;4*5i;F zAXF2@?iL+2&avv6o0&~1AC8!}CM#?RE1MtWM$>u6G5(?237))~_m~g4_GH2O#tu3> z-lpS)-=)vpWyR`)K4|b!MdI6~YS+}uL&L-0gin&szjpYUh>JsmUw;vKvRnLoU+}qH zTI?*Xv4n9*&+{HjS@3)w)T!jOr6z~bnR5a9;K{^i`oUo?woy&t$JKRMPO+F$r$id@nDTC{C=4otogQXVCH21m)S^ zzarnSJm0Xg4t^o?4VJ9x3h(U|2h%6Mpt^i1x;IEjFGJg%|9jc$KV7Ws|7m*mas3bQP9GwEybZ310ryE0VR2J+t!#sXyj54U(99r4O10@7S?U4YpMGXc}- z>2^2YbnqWOmm|4uqb&i;N*hTx@7n1aS#$F#jaJAm=8f{x&5gD~mLSsBKx{<=R@OIm z`y*J;Q$;@bn#fwcq90Vv;7z_#l0dGcf&)dI$EUS#Vgqc)4Md->Lcy^w4pAWb+Mn{22 zf_2sJ-tI-U(egZU;VWWdlyD*f0|Cg)4^IEg4Vci+2xuRGc50!`oeXqgD!>5;B9^~= zvw8J%wVG84$Mz4LUPO?cUx?$O>E3>*~PFiPJJ)`EP`myb|tsMJdc_IDK z_vHVR*V$eVp~#uPLVTI0LoOmBVzo-obk8Bk_od9FS5;ry|424A_uZGx7=e@KT$_(g zynR=2Z#AZhFeXZN0fdI}47iB3OR%Rsxelj0gwTYBM8JesBd>NI(CX)bUY0{KGkN1e0bFLjGEok3-cw7ojtP_h^LgE%ozg^ ze6M8=H^F4)UxDaF(@3m|D53cbbs8y!NN8MbV(Vw@Nl{TK%U*{SoGi!g!&JJD_f{G+ z+(<>zqF@3M-@2}@ZdQ9;N%MG$k)P+*Aeq0QLdxM6cjb0^mHlQi`$*w`h#22%4^_-7 zjO8WlQg!MqHq&}O6aMl6!j@c{6mn{r!%22Ziu)i?ROy{8 zw_w?NGGlJk@wcz5lI%5G8&uJJczKaiFa91$@wyZE*5-VFsDz^^bvj?zavuKpG5C$G zW<(g9*$_Gk0gsDRm0`zDz4fO%TndS3wX;F!5U_#X52$x|qd=}gK~Fz?Z3qNl2NI#)AF(j(n>RwGknzDI2NI0S0tLH^ASmRh zeSrLC^Cn6xq=b_gh2RGcdj=04jaye zwp+r>iveWn6GFr4wz4+!*=-e}MmM&3`x!!2w%G^ADpNAS!{#O}qL5v+V&%LMY&bS} zSj&PIjZ1b#-gJ?98G;ebYZO~QViQ0?sW#zw9^c`8{qGDqR9LlRbodLY=bQ3BVA~5t zHx$>`*UyKGs;zZi_PJm_gZKVM@E%dy_|i5B(YkbP(B%kDR8%|n0oBfKdv_N|)lR+C z5r$T?7a!NJgDiuanDF$oEnyPm&w73Ae@3IbF^ z8LMtus_xYNEkmcY36?t%$Y+V`9oz`-eiQ~sIzr`K`mTYeT}e*N_mId*gfYPvvK$xZ zAIJ9JY^pR<^fdcK(C_#!TxWC{=dKc~se?g@jFNmO`5UseZd4G6g9`v`{E&Yq^h*GY)t?(Cq z7SNm>2&$Vkyt>} z;oB1g_Z(4Pi)fXR(2Zg1D|r3`i*cr_rJG_wBPt>~x`IbIcc#{S2;R1!DHh5UEL<0XpdoUBIQ8ekbWmRv?zX*@HBjfy1&3XHxc?%RJr>*@-nKQZf z0i)q9SkIgqv6McUCo3Ethb5I#*4E#PU(NloMj>A4QvGEF3RP;RObxhqqCqCrSw_7T zB&=eLoN`V3Zp*Jf2L{?rt0VBCMxX=s*mjc$OO&bF@#*mSm4BBRH9ANvzk`cxJ&XLd zxLj{Ny>1-8x&Cwh(4krQ=+OOiaqE+L`;&0KlMW#aJc>#>F>Ep>Ecq+w1SFKe)tYep z8DZ4kCt-M`I5PxvexAs_9L{OcMh%)U6&j}M>cy&Zh{fOSVX7Cd-phLRfHXozA52d} z-BOz2K^MASM*ehV@mfnuTmq0jS~tA4yh)XAS4kskTdkR&;n9M*5H%3_3Lg>@IXZfR z4U6dl@#7qcXzIR0`s!ykGva3EQE%ilAwMc5^LE#-;E){IodwvecQEYw_CccGaU*WEGG}y zGQzY{*?~tW#2B5*cs!aWfSrWHIDp&)3Ox?K54I2bzMdO*RFAKT#Z>j>eZy)bRD#!E z1*eoH*OJ=f?(ueEdCXyD$DF5~xjBwS*CogMwnEc`83Z8Jz}1``DchM%eHr`_N*+X! zh8u81f-Ja`U~TiER)x2J{82=!6U zfnP`1Fzfg*RDfvEDpouH;jGl@myZ+f3y|&S_h)u5(HR#6^NW2s6gBhMB=dt~O^zPd zAYlIhOU+br#}zsZJ3aOQ8+I;v%R(bzrd21`yay*HQl?i zN``GVYHpy}32!rad*XDsavuSlNEFZ;M6>!Y0n6n|yL>BqTf>n${UzLR?yZa5@YnQoHxG5t|OVHyl! zx&hXbf4gLrH^v7qj3B9f8B9&X z_hlS{;x|?^W+r=Z*#8?$)nQ#{(ZS_u?k6S_{qAN!DtD_e#V{iNeGIyIl(EGN#H{sv zS~QM;O2}5IR;<)%uRoI9ai2P$Nlw`>Mjoo}30oK~7BCDC4ZB-FgBX_xvM>waaCK`K zUyc4Wz*zk?7bXSP8MrsS90I(gcch(9RN{Qy(D2lVOw~Zh3eZs_YXl=S2LIE=y-cPtbs*(!A!ijSVZ?h2 zr^@ZLk~%yM2?HTrQG-uh6_#t|*%d>3nL6C=C+%=Rtt$^1^0c&;_rG>Be_PE(ZrmML zXP`c8}DZpsXI&20LN;D68L+iwAtIIvrG1mi+s4Uh<8qE}(?^vT~ulkfK zO5r|=2B?_3XAouIaK>F?Z3UwXCuAgIV$rSsGd~ObtCq4K86Xws>Qs*Pqx4n1kK@6+ zFE7#-VY}b;q}520j$x9m9};8QV)~*Pp@xFQ%x?q&^%($O#qI+1^BZi}1Vk%F&vc%yYa2Q}ubbA-AnW$%Qj?vJEMdHv61v1^jYCS?q41CPS(XZD;(~w&aI*aE~0^v zx`oCn_b&R_OBnM$Pnf~#`#KFR%VRrjZg{*uy=NNaOX*;?ajWC&*=X5ex)fWWr_ekI z-Xs_^nnXv0avn}7mZ&CtVDD+-cRWp^3+cQ@FfT*kE~HqzSUFiKwcvqS#PQsugUl$02NsI81-x#jmDTTRze4{K^#J#T*X{7^s2CP59;O-FXj96iX6`Oyqh~dJZ-kBh=2z3y7 z4f=(SqaD>($U=2HZ<0-AT>xfk>!p1a?vVa%6VLpN1&Q8*iaOSFzZ@AGGu#mIH6KE% zBBHk;pV+woO&TEHUkB%GwFraAV7yO;UIc(2e%bso)G1}Umw4D0d}uL^^=b~67u>25 z!xDla-+$$P&Ve?|u74%R5_O0ew`oIO!s!coW6)(28GLB~w1?1-P0F^!Z0dY{&C*i^ z*x}WQlgYt?x~gteqX(E!u{bwQD+)Mme00(YQUSN4<@TWE5I23$s<#@5COiQjVexMGwt5W&=I@{fGWIxc0QIp72p`cw|Ql3THA&jCS6o(uJ! zFj6t3h0X9WHk(zT$Boi6E@-qW?uLg-3c(>hDE|7}IQ-XU96k;n59nq++;6?3PlS0Q zW6+lBG>o2OYsFXU2sxat_I~FH*&lge7%whT-wVrIwB2Xu?f@&G$I~sIme;%*b&=Dn zL9Q5A4s~_)AC{IDzDH?Y+xHO>%=Dq|R|1QsdAIyjVM^j1vVsqbmCTj$oXS4_;zik0+Dz{xr( z`i3)oKDITNT6%@tPN%{(Wa&{&+-`ZVkzLw3KYAg@y zK+XT?_*? zSB;)YjEggd%tl^>l6owlmA0IU&sq`vwMY383{(m(PrKHCs??_xaXE#8AR~&B-Rz3B zoAR2Pu2`!r>odKQkojQaee8gNwq`!U#To|VrxgT(reBq0-arhZmsCOHXd!)zU{ zS>ev&XaYui1?UId$8Tvxopi06dzu!T^hsZt@cmOi1qN$Ji;{y+(KC8@!pXq~1h&>8 zNt90JhL7m|4ab6KdwRy<5t0#HC+XBKoxGo%R01QwGT+BhheJm{SZVE6KBDz~RU655 z*?0O^0%%??7!@ET=qu#yH|H>LgEUtn76Q z3e$|w^%K@2pRuCf{JCsW4La}dkZZK(iiNhah|{;gJ@J8`8jBO9+h|`c!`%EC?&Jc1qA3LFQzu#t#;u?%5L=6QutigqP#qx4UnmW~s@D`sUwj^$cmEsl#R*S62VZ;x-OV9Ze%=jI4&bl%zQYWo}9dV^>NG9&cQFm@P>S@ zd6Q3B65WelrSZ}@NQB}(M6#E%?>ajA!7}s?8{6v~UKvogWwz=~1^+lu^*z^jlr&NW zH+#n}x4pXW4K&Clfz|TnUH7@!7US2gOKc-{n0$B!Fv#>eX-pr-<^U@OR3Rg8 z+&oY#|4go?e?w`279_pmF3HEmzWc||f4KO$Vs5iur^SDBt52^gsOxM>Z=z__!|jDE z(-VyAIBmqWDc_{PgziR7UvtvOcRV#VrW{w%XFsRHh1Iwv?q0N{r1R{0DQAB4uL(#s z$y*scReuS$qW-R)DL9#9ctkNlSjsBsqlxpDtfxX6jR?XV>j|k8jocha>W~t&KC7M?v88q{B zY?Ei$Hc|zN31F3)6m^$FB!6!^;_m?Y`%4F%gh(!e?rMXme4O1E>Wt)~`te3;dPlCq zJbAL8r$pIQCVp)&WagHII;_0Pc^#Ombq|)5fL`W?&{@E?E&qIdNom2t$oSpQmY(d@ zt5=^tv?xbgf~rtoH0$lK5KXb~yUz4DcOi8QLVE`s!mieNXW>WXRDCQA1X$?N>Hs;G z*oJGZxG)pV3CiwYXX-@q)KZ!+V+D=;!G5Pw3Ih!xxP_C5r8witJr3A-NJe5$Af%&q zlnhyc-gjQPIxP97^Getri!Jm$&<;(J}N|lo`4dEcIjK_D810z)C@PAJ2R`z7F!&Ad_%FM z73~W%TpG!yG1>%&hwP>#g_1c+Vi_E|=afWHwM9!6IxIDUmmOy*->YftBN6+}TEq3N zVtUgD-%e%tiRH^#bH}-@{_mgItF#{WNU%gqfcU92P)03tHHK{dys?IkxH?~_Ju@Rn z&haZcv*y`Zs>fql*h6MoN}RsRo`LIk~|Spycw*es>v15V9#M6r zR>4vo676tAr@kx%;6mGgPDI0^5*sCI!fu7Ip2N`F68u z@l0R9~Pjo`yd;Kyq%r78)-$$Ee?x8 z`36jw8(VKo_zPFln8yy6vorSi#c&VPN$6?$r~C(rKb*aGoc>QOK1Z+S_Aah$a;S3Lw* zk+HeuItmx>kb>Za5L~B-W|DV1DQ>HnF-Is^ zn_z8%@v`%%)Pzb<#*JQ6?U9HS{heLhSPHN9G5!)!?g>*f@;dSd80tMQXJcnRTak|> zmuCC=&lUaWL-f6uhv4?s1NS^QJ*dFR^q;TWA&TH5VEew^u{f*0$C1i(bUjK%O?_)9 z!Mnl^_4}=|U1Tqjf4tQe^1?T)TtkR4F`SA}@Pmx_(LNCo9g@Sn*#lWtL41VN1~g0Vpv`HLU%mT@lyNId`ws#P2|G6p$DRm%2ZFj)2{Dxi@3 zPG2t~Amwc)(i##vcZ}mW&Q;NdGO(9lHstwBjMR?DL}n(u2GKe~5nCX_oq~?mXH+7D}7?1Xmk~@>3=`H$VfN-%ued;)t%{L zxpAMyBcyq`10H7ddO-XcL|_Q6iH0wJ%uHP~&JUO{GFy;dooo*}97R!kx~G$t3k!sr z6-)Vk%98*V@BNdL6Uxa%?)Z43zTCf8Maxtto4?Fol=U!VO{0Y>6-o*<2B zj=GQlt8|bWAO}x8JaN`nO9%}b-N^q8Ree*OBUm8CZ_{~DeE)r_St;nGT9|mkA*g=s zvN`FDX^mvyR`R^J;&m$dySLI~Iwer9aY|swvuZ=66yTpiUjbl^%h?-CQ&8c&t*OfN zpWXk*%m*QNm!t9nV40Xo0XGeaT33s{fQI|sBj^vE0vNiKwGSTYH#~VW9IlgfGWT_6 znq2VcL{m=5wu`fV`74chXix*j#F<Gy_7>vz9D$u~E!yt-aziv*RN-?i!muG^F6w6G&NbRy7ub$yZPIk&rAKNG7+@+4t|_g+OvX?)mD2oo#TJOufy&-o2x7Q^jS^< zFxB%PEb?GsasR}gwUxlZB-f>YQC;-bl*)sl4E)vdu~%iYzh149as(Lc#GF?J7@>v2 zHi<)G096?zC2gJ;B?||E!$S>N>pJd8W<2SmJ#e@~0NGHF+)NHk&bWSl3xYdQ`R2<|-lo_s%yPu&tV# zKUf6jYCu+9wT)Q%mhe_jB^m@H^?i_s|39yqbq%_Vi|BMY{|nrC3H6Up?Kx=-m_ea)K7sK!7$0+kQkwg0)g9f@|wc(|#O1njX|sjXjK?yT1O_OqA? zQ!id(Ic<{S73VlXv+$sLqCTx|it#ZdSno1FZyd<_9j!^#_w|Ilx41js`^&<~Il(=2 z^(FdqF5yEOrXed%s>8QZYJ3*`G~hYl$DcACc{fIK@@I6!lB{Qwlg2cWR_Y1@$j{=* zsf#E*tVh^195rjnh7{&ybLUx%R8K0r_)AGWMMtKt>AeiyWUv&itcS_I;o;?cZ66X; zAHtBiVIB6q|0a?DWag|g$x#hPKzT2nP3Z~EW{U)qd`Pj0N0d_L$+x^4uY0&jl{1Q6 zx$ZfAxLqG~n%Lj9!efTOI1Sww?Ct$emXN|2C_*(T&kTm0dmwYZTM}OhMplb>wbBDF zXs-7-5?^_Ec+g{E0^E357($DTxnNJ3n30!D z3QKv4du1;a0vhMZcy=6GU82e#yx@PZwlu$3on5T7uRp4Rdnf&1e= z`b{GO56H6>=gpn^jYNP-bNcr>eHLIakw!eZw(W|DPak#nKZwR4IQVDDrwC)fPJnKnkM?fT75^<^Wf1pr&y2=Hm$opEl+@=yEn(gRa+1M09GGh2m)W@Jy zGRgcW-`M#1J*p}%VA1h^!ftBcdrj{s5rq#}hF->A^+7Q-*lS1NXEIQ1N zn3xKh(#&)cU)b4^pA?4OZnHt`bo@7KgH=O@#@f-Jm?2O-=(8+5>T&-^z#Vg)bR0AD zV0|bZgNmEoiv`P0F^Vz19=emnW`i&KY5$Y#M`sMke2(??F-^}d*#I}7s2gN~r{jk}cF#NR)G zDrFEN%cDU%wTU8jgLd}az$=kN2XRkC(#0o1ltBD0tr4G+Ex6xAJ zEheTwST=i^#5ZmDp?Jy)9;+&5e$qyej z*Y{T3ylHVNnP6-QWmSAm1gLeTFX{Reb+WiqCA8XDSy+belhJP=)x7U`dF$xzo&!A7 zW`b-;vY3Zp-`Bqd4gd}JhZ@A=NaNd#q~>E^}Vn&+V;Z^pw%jE8Q z)0yEnb(Rfs`Mf}m8~CFSym9hf8f@vbO;sG!9M~k1Jt-<>Ac!Yc!ulGyltRfEWCr3b z$uXrm1SP(L;*OZPC_OuN!ACH@xf<$#%pVSla&t7YK^L3DV~WGH*>8TIuBz_kL)NYXUHPyw?ia30LS9*W zE28@OhS=al53}{@XmZ!AYklQ*)UIk2`TO`GA#?^fY^CL>HMbq>73A;PKc0&fne8Ei zCQA8?WJYG*!6-`|A0Iu0MZ)a`!Lp?|1|6p)NE=>lyrW|JnnI-u1@z_@a(%br#BDSI zy_vXis8+j9MLtD0v3z#8m1HQ{rlrc-@I(Iw^lZOZ#rc1nv4{R04+ zI432sD915e@!tJhe&g&l100P5#>s)_zI z%n^SZY%iVj`@5w4?wlI{pUdcW`PgYau9uT8=oJYxH7nIIsB99LG|vSBDKoj;bVUKn zsxR==Lw9+!Abi0CndX`&NQe6K_!;9|n!3~Nf6dX;dK!vc!v`;JBVv^e;u$n2n?(>7 zB`838>kVIuyY9;Q;JQ?IG}~%_6_%m+S>1$g%gM*5s$7SRj10}%aT~)dezFEz&65u( zIV~i)TTBB!ER}$e2c`k}&FrT%$@rsW;e-t6sgGuABRaTjGJ_?PhFzQDEf$Ub)A{d} zYulmglOVVj+b{678ceu*I5P8otQ--mxXG}xViv?EYDxvkMa~EW}O z-Ye+5gg#)|9MNfrf7jG+<8Dh0r_yqZ#DWY7rVPCX?oTIQe#zK_w{=jkUN))HihRhC zeaD$#h;a*LD4Eru5SP+aCOFCqa2wHM$n-fT;h>tqBwz>HV98BwHJ6{_EP&Z6vF-D0 zfJ9?_l@FDY?0990@w^Oo1~ zYyw~p&LjQ9Upr^&&%liQP-bJ}<|9-1|Bu`lbpC+{kzHHHK7&RqlNMx!e>do_(F6ik zqyA;O#>Nu|YlU&zZ@*fF?5^b(VBvN`WN@o~yA1!)FQC@XtJN8)xlIp1J>L9%*sQdw zml^i$@Oh+A(3yW9gyZGsgWrW)=W28F(nzym8|YD;_2r<&Z+$CL!ECSd#t{V@bli`X zprEFPIs2<%xIy#mY%__Pwg!5|TVnZ#9!mCzX)40KaQ;m3eNLB<1SEx7VGu1koixrr zI?tx0tm6XMlS}e93(q`zu>^L#b^4z?^)K`B_4OY9LH)6z>sWqfmlC!3h}(hSp#uNp zS==Y@I>g$7YenaQpZH;M(o>xf2xgqt%$$Qjq`D+W4{uY1&EKQjEZvH8EKE10j7mRd zLzdS})gGQClK9&&%}1+RWquO@iluM8h7}bWW0KioAQ*O$<;bz5%o(>~GCl5IxPXz?WenkK1k+ns)6Ru4IpPC@VJ~bU; zqV{jg`L#+4Ldo^cq6BK|Bi@8h-P{-3eRrH0^jr0}K_V__+2l!vvjT1hi$YWJ5@zPf zQ&mn@P7MJ>jgb)Y0nRs!xMq5oy8bGQ^x?u%ekq+-6d%z8zOud$bwpZ4i3Ex|Nc)q* z$W{1HxkLnIudxfcCIa5+mRq-W5m$!6p{s(<{Y{k~z(St^wGMt>hKtFD*DTTNvQdvw zFe^^EP5D+xHZyui>6oN4{6?Iku_zhyYjdkfOdoBuxe6`~9&&pQ0bFEKw zWxls(>wU9mw70a*0dQ0NoM8|2gvrP=L(Rt-zmf_KrCf5q{Mebcnl$_$Ru*1P+#K1W zG^I3qRq`O8Cnjrmhd68j-8RIc74G-;md41eEK6mryc)tgm+fFhCvI<=d~0G?behYm zZT#>kzPmJ~bH6BCQ2n;oUm|C>C$M&A%)`nq(4#G;vzHB+(-6%eVt+aU#emxsBgzVk zVn>6%Iw$sU@vt4}3;vl5n*8f*cB3RfT>D8MJLfNA-fuZXxJB%_>FLOgJDmd8P1nw3bcx1UP@}2@HJC%mfGYUvV^p@T_;c7mg;PJ@NmCG#33naRk^j!RLx|6Zd8Kbp`AEG$h!AxrOmT zYw84F6Pbm4t6p2E-0U}Y)^|cSOLRDvtrHNOaQ|3>@Kija(7%{FUOx`Nh3auX#S0ix ziq55K`0;(B>2mm(WBM6Yn8ibJaY)RB%d0%Ju=h9>|2xeJWh-LDa$|KQ@rwOcMn-BtAVR(i9B?w?rMDJdU<)9T6U1ezk z-jFfs>!U5d^uP2#&gPJ}n_{h02}9o3gk}!83zhyClT9`U$3-N0JA3Lm^qps6I@ETm zYRDjYXmgdUxV)L(+4`#CDnbbHoH4OlD(Id-5x!QONyL8>ns~oi&qr>4@2^J;6zMYV z4wcI?7m&?#lBADeDWT7TKJoabf(Sq91suxiw%yAZ8%yuDsxZt8sLH1nee#zr^jx(=m z%RI`fGSgFlEHTH)15((7-^mAWiPk)WLm_ZQbMgwqC^=5aEA6$($SUG&zugbjdBT%f&!<6Q%H zH=EXy+~raUgKOqLtdUgc_lq|!Me^TOL!hkP2lsIfB%&=rS<@XBAHol3oR`P1ByYzm zfOF8;6}|181f-FK?KMN?35QFk^?J%uHEbQ@K5RXd1*7dpFp7TdBISf*Q4`0=95TkJ z*{c-x^8MQ+xA|-mWNW$~oxx3=!D3$=$@i8o@J_~+7d$=^=~h;YktmW*-ra4h08(RJ z&fu_!a`&eoY20ip&7;Pr#0N**q%EE$vHS5Rrr%Id3D(L$(y(h6ndRe}@)!FmL0tL* zRF{h)9Qwpv3v388v<;+1ME-#>A29!#-(zocd{2xo&tj((gMkxou3NHLH!ftsS=Zvw zZF0=H;TVhA_$8_@bz_t8XIe^GN99G8`tQxn0iilC`fiTgk1dw>(Tzk+6;x**@WL$p zQJ@=Io%eHxSx1DhthDCrfpm^5Ja3haq|<#f{IXm<%dj4_J?&WHw){wa+M=mloIHlN ztJx)x3A(Ib!*TWs#~{7RLth zSAATi59wgv`5q({ru)W61?xhx){GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ diff --git a/samples/client/petstore/python-prior/tests/__init__.py b/samples/client/petstore/python-prior/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-prior/tests/test_api_client.py b/samples/client/petstore/python-prior/tests/test_api_client.py deleted file mode 100644 index 5a4e36035bfe..000000000000 --- a/samples/client/petstore/python-prior/tests/test_api_client.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - -import os -import time -import atexit -import weakref -import unittest -from dateutil.parser import parse - -import petstore_api -import petstore_api.configuration - -HOST = 'http://petstore.swagger.io/v2' - - -class ApiClientTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - - def test_configuration(self): - config = petstore_api.Configuration() - config.host = 'http://localhost/' - - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = 'PREFIX' - config.username = 'test_username' - config.password = 'test_password' - - header_params = {'test1': 'value1'} - query_params = {'test2': 'value2'} - auth_settings = ['api_key', 'unknown'] - - client = petstore_api.ApiClient(config) - - # test prefix - self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) - - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - - # test api key auth - self.assertEqual(header_params['test1'], 'value1') - self.assertEqual(header_params['api_key'], 'PREFIX 123456') - self.assertEqual(query_params['test2'], 'value2') - - # test basic auth - self.assertEqual('test_username', client.configuration.username) - self.assertEqual('test_password', client.configuration.password) - - # test api key without prefix - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = None - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], '123456') - - # test api key with empty prefix - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = '' - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], '123456') - - # test api key with prefix specified in the api_key, useful when the prefix - # must include '=' sign followed by the API key secret without space. - config.api_key['api_key'] = 'PREFIX=123456' - config.api_key_prefix['api_key'] = None - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], 'PREFIX=123456') - - - def test_select_header_accept(self): - accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/json', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/xml', 'application/json'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['text/plain', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'text/plain, application/xml') - - accepts = [] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, None) - - def test_select_header_content_type(self): - content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/json', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/xml', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['text/plain', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'text/plain') - - content_types = [] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, None) - - content_types = ['application/json-patch+json', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types, - 'PATCH', [{ "op": "add", "path": "/myPath", "value": ["myValue"]}]) - self.assertEqual(content_type, 'application/json-patch+json') - - content_types = ['application/json-patch+json', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types, - 'PATCH', {"value": ["myValue"]}) - self.assertEqual(content_type, 'application/json') - - def test_sanitize_for_serialization(self): - # None - data = None - result = self.api_client.sanitize_for_serialization(None) - self.assertEqual(result, data) - - # str - data = "test string" - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # int - data = 1 - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # bool - data = True - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # date - data = parse("1997-07-16").date() # date - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16") - - # datetime - data = parse("1997-07-16T19:20:30.45+01:00") # datetime - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") - - # list - data = [1] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # dict - data = {"test key": "test value"} - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # model - pet_dict = {"id": 1, "name": "monkey", - "category": {"id": 1, "name": "test category"}, - "tags": [{"id": 1, "fullName": "test tag1"}, - {"id": 2, "fullName": "test tag2"}], - "status": "available", - "photoUrls": ["http://foo.bar.com/3", - "http://foo.bar.com/4"]} - from petstore_api.model.pet import Pet - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - from petstore_api.model.string_boolean_map import StringBooleanMap - pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) - pet.id = pet_dict["id"] - cate = Category() - cate.id = pet_dict["category"]["id"] - cate.name = pet_dict["category"]["name"] - pet.category = cate - tag1 = Tag() - tag1.id = pet_dict["tags"][0]["id"] - tag1.full_name = pet_dict["tags"][0]["fullName"] - tag2 = Tag() - tag2.id = pet_dict["tags"][1]["id"] - tag2.full_name = pet_dict["tags"][1]["fullName"] - pet.tags = [tag1, tag2] - pet.status = pet_dict["status"] - - data = pet - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, pet_dict) - - # list of models - list_of_pet_dict = [pet_dict] - data = [pet] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, list_of_pet_dict) - - # model with additional properties - model_dict = {'some_key': True} - model = StringBooleanMap(**model_dict) - result = self.api_client.sanitize_for_serialization(model) - self.assertEqual(result, model_dict) - - def test_context_manager_closes_threadpool(self): - with petstore_api.ApiClient() as client: - self.assertIsNotNone(client.pool) - pool_ref = weakref.ref(client._pool) - self.assertIsNotNone(pool_ref()) - self.assertIsNone(pool_ref()) - - def test_atexit_closes_threadpool(self): - client = petstore_api.ApiClient() - self.assertIsNotNone(client.pool) - self.assertIsNotNone(client._pool) - atexit._run_exitfuncs() - self.assertIsNone(client._pool) diff --git a/samples/client/petstore/python-prior/tests/test_api_exception.py b/samples/client/petstore/python-prior/tests/test_api_exception.py deleted file mode 100644 index 0d0771b57850..000000000000 --- a/samples/client/petstore/python-prior/tests/test_api_exception.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import six -import sys -import unittest - -import petstore_api - -from .util import id_gen - -class ApiExceptionTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - from petstore_api.api.pet_api import PetApi - self.pet_api = PetApi(self.api_client) - self.setUpModels() - - def setUpModels(self): - from petstore_api.model import category, tag, pet - self.category = category.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = tag.Tag() - self.tag.id = id_gen() - self.tag.full_name = "blank" - self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def test_404_error(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id) - - with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"): - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - except petstore_api.ApiException as e: - self.assertEqual(e.status, 404) - self.assertEqual(e.reason, "Not Found") - self.checkRegex(e.body, "Pet not found") - - def test_500_error(self): - self.pet_api.add_pet(self.pet) - - with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"): - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special" - ) - - try: - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special" - ) - except petstore_api.ApiException as e: - self.assertEqual(e.status, 500) - self.assertEqual(e.reason, "Internal Server Error") - self.checkRegex(e.body, "Error 500 Internal Server Error") - - def checkRaiseRegex(self, expected_exception, expected_regex): - if sys.version_info < (3, 0): - return self.assertRaisesRegexp(expected_exception, expected_regex) - - return self.assertRaisesRegex(expected_exception, expected_regex) - - def checkRegex(self, text, expected_regex): - if sys.version_info < (3, 0): - return self.assertRegexpMatches(text, expected_regex) - - return self.assertRegex(text, expected_regex) diff --git a/samples/client/petstore/python-prior/tests/test_deserialization.py b/samples/client/petstore/python-prior/tests/test_deserialization.py deleted file mode 100644 index e9ef8951fa2d..000000000000 --- a/samples/client/petstore/python-prior/tests/test_deserialization.py +++ /dev/null @@ -1,441 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import os -import time -import unittest -import datetime - -import six - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) -from petstore_api.model import ( - enum_test, - pet, - animal, - dog, - parent_pet, - child_lizard, - category, - string_enum, - number_with_validations, - string_boolean_map, -) -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -from petstore_api.rest import RESTResponse - -MockResponse = namedtuple('MockResponse', 'data') - -class DeserializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.deserialize = self.api_client.deserialize - - def test_enum_test(self): - """ deserialize dict(str, Enum_Test) """ - data = { - 'enum_test': { - "enum_string": "UPPER", - "enum_string_required": "lower", - "enum_integer": 1, - "enum_number": 1.1, - "stringEnum": "placed" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (enum_test.EnumTest,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue( - isinstance(deserialized['enum_test'], enum_test.EnumTest)) - value = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) - string_enum_val = string_enum.StringEnum(value) - sample_instance = enum_test.EnumTest( - enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - string_enum=string_enum_val - ) - self.assertEqual(deserialized['enum_test'], sample_instance) - - def test_deserialize_dict_str_pet(self): - """ deserialize dict(str, Pet) """ - data = { - 'pet': { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (pet.Pet,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['pet'], pet.Pet)) - - def test_deserialize_dict_str_dog(self): - """ deserialize dict(str, Dog), use discriminator""" - data = { - 'dog': { - "className": "Dog", - "color": "white", - "breed": "Jack Russel Terrier" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (animal.Animal,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - dog_inst = deserialized['dog'] - self.assertTrue(isinstance(dog_inst, dog.Dog)) - self.assertEqual(dog_inst.class_name, "Dog") - self.assertEqual(dog_inst.color, "white") - self.assertEqual(dog_inst.breed, "Jack Russel Terrier") - - def test_deserialize_lizard(self): - """ deserialize ChildLizard, use discriminator""" - data = { - "pet_type": "ChildLizard", - "lovesRocks": True - } - response = MockResponse(data=json.dumps(data)) - - lizard = self.deserialize(response, - (parent_pet.ParentPet,), True) - self.assertTrue(isinstance(lizard, child_lizard.ChildLizard)) - self.assertEqual(lizard.pet_type, "ChildLizard") - self.assertEqual(lizard.loves_rocks, True) - - def test_deserialize_dict_str_int(self): - """ deserialize dict(str, int) """ - data = { - 'integer': 1 - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, ({str: (int,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['integer'], int)) - - def test_deserialize_str(self): - """ deserialize str """ - data = "test str" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (str,), True) - self.assertTrue(isinstance(deserialized, str)) - - def test_deserialize_date(self): - """ deserialize date """ - data = "1997-07-16" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (datetime.date,), True) - self.assertTrue(isinstance(deserialized, datetime.date)) - - def test_deserialize_datetime(self): - """ deserialize datetime """ - data = "1997-07-16T19:20:30.45+01:00" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (datetime.datetime,), True) - self.assertTrue(isinstance(deserialized, datetime.datetime)) - - def test_deserialize_pet(self): - """ deserialize pet """ - data = { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (pet.Pet,), True) - self.assertTrue(isinstance(deserialized, pet.Pet)) - self.assertEqual(deserialized.id, 0) - self.assertEqual(deserialized.name, "doggie") - self.assertTrue(isinstance(deserialized.category, category.Category)) - self.assertEqual(deserialized.category.name, "string") - self.assertTrue(isinstance(deserialized.tags, list)) - self.assertEqual(deserialized.tags[0].full_name, "string") - - def test_deserialize_list_of_pet(self): - """ deserialize list[Pet] """ - data = [ - { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie0", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - }, - { - "id": 1, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie1", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - }] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ([pet.Pet],), True) - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], pet.Pet)) - self.assertEqual(deserialized[0].id, 0) - self.assertEqual(deserialized[1].id, 1) - self.assertEqual(deserialized[0].name, "doggie0") - self.assertEqual(deserialized[1].name, "doggie1") - - def test_deserialize_nested_dict(self): - """ deserialize dict(str, dict(str, int)) """ - data = { - "foo": { - "bar": 1 - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: ({str: (int,)},)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized["foo"], dict)) - self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) - - def test_deserialize_nested_list(self): - """ deserialize list[list[str]] """ - data = [["foo"]] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, ([[str]],), True) - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], list)) - self.assertTrue(isinstance(deserialized[0][0], str)) - - def test_deserialize_none(self): - """ deserialize None """ - response = MockResponse(data=json.dumps(None)) - - error_msg = ( - "Invalid type for variable 'received_data'. Required value type is " - "datetime and passed type was NoneType at ['received_data']" - ) - with self.assertRaises(ApiTypeError) as exc: - deserialized = self.deserialize(response, (datetime.datetime,), True) - self.assertEqual(str(exc.exception), error_msg) - - def test_deserialize_OuterEnum(self): - """ deserialize OuterEnum """ - # make sure that an exception is thrown on an invalid value - with self.assertRaises(ApiValueError): - self.deserialize( - MockResponse(data=json.dumps("test str")), - (string_enum.StringEnum,), - True - ) - - # valid value works - placed_str = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"] - ) - response = MockResponse(data=json.dumps(placed_str)) - deserialized = self.deserialize(response, - (string_enum.StringEnum,), True) - self.assertTrue(isinstance(deserialized, string_enum.StringEnum)) - self.assertTrue(deserialized.value == placed_str) - - def test_deserialize_NumberWithValidations(self): - """ deserialize NumberWithValidations """ - # make sure that an exception is thrown on an invalid type value - with self.assertRaises(ApiTypeError): - deserialized = self.deserialize( - MockResponse(data=json.dumps("test str")), - (number_with_validations.NumberWithValidations,), - True - ) - - # make sure that an exception is thrown on an invalid value - with self.assertRaises(ApiValueError): - deserialized = self.deserialize( - MockResponse(data=json.dumps(21.0)), - (number_with_validations.NumberWithValidations,), - True - ) - - # valid value works - number_val = 11.0 - response = MockResponse(data=json.dumps(number_val)) - number = self.deserialize(response, - (number_with_validations.NumberWithValidations,), True) - self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) - self.assertTrue(number.value == number_val) - - def test_deserialize_file(self): - """Ensures that file deserialization works""" - response_types_mixed = (file_type,) - - # sample from http://www.jtricks.com/download-text - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {'Content-Disposition': 'attachment; filename=content.txt'} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - file_data = ( - "You are reading text file that was supposed to be downloaded\r\n" - "to your hard disk. If your browser offered to save you the file," - "\r\nthen it handled the Content-Disposition header correctly." - ) - http_response = HTTPResponse( - status=200, - reason='OK', - data=file_data, - getheaders=get_headers, - getheader=get_header - ) - # response which is deserialized to a file - mock_response = RESTResponse(http_response) - file_path = None - try: - file_object = self.deserialize( - mock_response, response_types_mixed, True) - self.assertTrue(isinstance(file_object, file_type)) - file_path = file_object.name - self.assertFalse(file_object.closed) - file_object.close() - if six.PY3: - file_data = file_data.encode('utf-8') - with open(file_path, 'rb') as other_file_object: - self.assertEqual(other_file_object.read(), file_data) - finally: - os.unlink(file_path) - - def test_deserialize_binary_to_str(self): - """Ensures that bytes deserialization works""" - response_types_mixed = (str,) - - # sample from http://www.jtricks.com/download-text - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - data = "str" - - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), - getheaders=get_headers, - getheader=get_header - ) - - mock_response = RESTResponse(http_response) - - result = self.deserialize(mock_response, response_types_mixed, True) - self.assertEqual(isinstance(result, str), True) - self.assertEqual(result, data) - - def test_deserialize_string_boolean_map(self): - """ - Ensures that string boolean (additional properties) - deserialization works - """ - # make sure that an exception is thrown on an invalid type - with self.assertRaises(ApiTypeError): - deserialized = self.deserialize( - MockResponse(data=json.dumps("test str")), - (string_boolean_map.StringBooleanMap,), - True - ) - - # valid value works - item_val = {'some_key': True} - response = MockResponse(data=json.dumps(item_val)) - model = string_boolean_map.StringBooleanMap(**item_val) - deserialized = self.deserialize(response, - (string_boolean_map.StringBooleanMap,), True) - self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap)) - self.assertTrue(deserialized['some_key'] == True) - self.assertTrue(deserialized == model) - diff --git a/samples/client/petstore/python-prior/tests/test_pet_api.py b/samples/client/petstore/python-prior/tests/test_pet_api.py deleted file mode 100644 index 0753f64b238d..000000000000 --- a/samples/client/petstore/python-prior/tests/test_pet_api.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -from collections import namedtuple -import json -import os -import unittest - -import petstore_api -from petstore_api import Configuration -from petstore_api.rest import ( - RESTClientObject, - RESTResponse -) - -import six - -from petstore_api.exceptions import ( - ApiException, - ApiValueError, - ApiTypeError, -) -from petstore_api.api.pet_api import PetApi -from petstore_api.model import pet -from .util import id_gen - -import urllib3 - -if six.PY3: - from unittest.mock import patch -else: - from mock import patch - -HOST = 'http://localhost/v2' - - -class TimeoutWithEqual(urllib3.Timeout): - def __init__(self, *arg, **kwargs): - super(TimeoutWithEqual, self).__init__(*arg, **kwargs) - - def __eq__(self, other): - return self._read == other._read and self._connect == other._connect and self.total == other.total - - -class MockPoolManager(object): - def __init__(self, tc): - self._tc = tc - self._reqs = [] - - def expect_request(self, *args, **kwargs): - self._reqs.append((args, kwargs)) - - def request(self, *args, **kwargs): - self._tc.assertTrue(len(self._reqs) > 0) - r = self._reqs.pop(0) - self._tc.maxDiff = None - self._tc.assertEqual(r[0], args) - self._tc.assertEqual(r[1], kwargs) - return urllib3.HTTPResponse(status=200, body=b'test') - - -class PetApiTests(unittest.TestCase): - - def setUp(self): - config = Configuration() - config.host = HOST - config.access_token = 'ACCESS_TOKEN' - self.api_client = petstore_api.ApiClient(config) - self.pet_api = PetApi(self.api_client) - self.setUpModels() - self.setUpFiles() - - def setUpModels(self): - from petstore_api.model import category, tag - self.category = category.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = tag.Tag() - self.tag.id = id_gen() - self.tag.name = "python-pet-tag" - self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def setUpFiles(self): - self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") - self.test_file_dir = os.path.realpath(self.test_file_dir) - - def test_preload_content_flag(self): - self.pet_api.add_pet(self.pet) - - resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) - - # return response should at least have read and close methods. - self.assertTrue(hasattr(resp, 'read')) - self.assertTrue(hasattr(resp, 'close')) - - # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. - self.assertTrue(hasattr(resp, 'release_conn')) - - # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking - # change, however supporting above methods should be enough for most usecases. Remove this test case if - # we followed the breaking change procedure for python client (e.g. increasing major version). - self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') - - resp.close() - resp.release_conn() - - def test_config(self): - config = Configuration(host=HOST) - self.assertIsNotNone(config.get_host_settings()) - self.assertEqual(config.get_basic_auth_token(), - urllib3.util.make_headers(basic_auth=":").get('authorization')) - # No authentication scheme has been configured at this point, so auth_settings() - # should return an empty list. - self.assertEqual(len(config.auth_settings()), 0) - # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters. - config.access_token = 'MY-ACCESS_TOKEN' - self.assertEqual(len(config.auth_settings()), 1) - self.assertIn("petstore_auth", config.auth_settings().keys()) - config.username = "user" - config.password = "password" - self.assertEqual( - config.get_basic_auth_token(), - urllib3.util.make_headers(basic_auth="user:password").get('authorization')) - self.assertEqual(len(config.auth_settings()), 2) - self.assertIn("petstore_auth", config.auth_settings().keys()) - self.assertIn("http_basic_test", config.auth_settings().keys()) - config.username = None - config.password = None - self.assertEqual(len(config.auth_settings()), 1) - self.assertIn("petstore_auth", config.auth_settings().keys()) - - def test_timeout(self): - mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - - self.pet_api.add_pet(self.pet, _request_timeout=5) - self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) - - def test_separate_default_client_instances(self): - pet_api = PetApi() - pet_api2 = PetApi() - self.assertNotEqual(pet_api.api_client, pet_api2.api_client) - - pet_api.api_client.user_agent = 'api client 3' - pet_api2.api_client.user_agent = 'api client 4' - - self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) - - def test_separate_default_config_instances(self): - pet_api = PetApi() - pet_api2 = PetApi() - self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) - - pet_api.api_client.configuration.host = 'somehost' - pet_api2.api_client.configuration.host = 'someotherhost' - self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - - def test_async_request(self): - thread = self.pet_api.add_pet(self.pet, async_req=True) - response = thread.get() - self.assertIsNone(response) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - result = thread.get() - self.assertIsInstance(result, pet.Pet) - - def test_async_with_result(self): - self.pet_api.add_pet(self.pet, async_req=False) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - - response = thread.get() - response2 = thread2.get() - - self.assertEqual(response.id, self.pet.id) - self.assertIsNotNone(response2.id, self.pet.id) - - def test_async_with_http_info(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True, - _return_http_data_only=False) - data, status, headers = thread.get() - - self.assertIsInstance(data, pet.Pet) - self.assertEqual(status, 200) - - def test_async_exception(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id(-9999999999999, async_req=True) - - exception = None - try: - thread.get() - except ApiException as e: - exception = e - - self.assertIsInstance(exception, ApiException) - self.assertEqual(exception.status, 404) - - def test_add_pet_and_get_pet_by_id(self): - self.pet_api.add_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertIsNotNone(fetched.category) - self.assertEqual(self.pet.category.name, fetched.category.name) - - def test_add_pet_and_get_pet_by_id_with_http_info(self): - self.pet_api.add_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id( - pet_id=self.pet.id, - _return_http_data_only=False - ) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched[0].id) - self.assertIsNotNone(fetched[0].category) - self.assertEqual(self.pet.category.name, fetched[0].category.name) - - def test_update_pet(self): - self.pet.name = "hello kity with updated" - self.pet_api.update_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(self.pet.name, fetched.name) - self.assertIsNotNone(fetched.category) - self.assertEqual(fetched.category.name, self.pet.category.name) - - def test_find_pets_by_status(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) - ) - - def test_find_pets_by_tags(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) - ) - - def test_update_pet_with_form(self): - self.pet_api.add_pet(self.pet) - - name = "hello kity with form updated" - status = "pending" - self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(name, fetched.name) - self.assertEqual(status, fetched.status) - - def test_upload_file(self): - # upload file with form parameter - file_path1 = os.path.join(self.test_file_dir, "1px_pic1.png") - file_path2 = os.path.join(self.test_file_dir, "1px_pic2.png") - try: - file = open(file_path1, "rb") - additional_metadata = "special" - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata=additional_metadata, - file=file - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file.close() - - # upload only one file - try: - file = open(file_path1, "rb") - self.pet_api.upload_file(pet_id=self.pet.id, file=file) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file.close() - - # upload multiple files - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - try: - file1 = open(file_path1, "rb") - file2 = open(file_path2, "rb") - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.pet_api.upload_file( - pet_id=684696917, files=[file1, file2]) - mock_method.assert_called_with( - 'POST', - 'http://localhost/v2/pet/684696917/uploadImage', - _preload_content=True, - _request_timeout=None, - body=None, - headers={ - 'Accept': 'application/json', - 'Content-Type': 'multipart/form-data', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python', - 'Authorization': 'Bearer ACCESS_TOKEN' - }, - post_params=[ - ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) - ], - query_params=[] - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - file2.close() - - # passing in an array of files to when file only allows one - # raises an exceptions - try: - file = open(file_path1, "rb") - with self.assertRaises(ApiTypeError) as exc: - self.pet_api.upload_file(pet_id=self.pet.id, file=[file]) - finally: - file.close() - - # passing in a single file when an array of file is required - # raises an exception - try: - file = open(file_path1, "rb") - with self.assertRaises(ApiTypeError) as exc: - self.pet_api.upload_file(pet_id=self.pet.id, files=file) - finally: - file.close() - - # passing in a closed file raises an exception - with self.assertRaises(ApiValueError) as exc: - file = open(file_path1, "rb") - file.close() - self.pet_api.upload_file(pet_id=self.pet.id, file=file) - - def test_delete_pet(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - raise Exception("expected an error") - except ApiException as e: - self.assertEqual(404, e.status) - - @patch.object(petstore_api.ApiClient, 'call_api') - @patch.object(petstore_api.ApiClient, 'select_header_content_type') - def test_call_select_header_content_type(self, mock_select_ct, mock_call_api): - mock_select_ct.return_value = 'application/json' - self.pet_api.add_pet(self.pet) - # check if all arguments are passed to select_header_content_type - mock_select_ct.assert_called_once_with( - ['application/json', 'application/xml'], - 'POST', - self.pet) - mock_call_api.assert_called_once() - self.assertEqual(mock_call_api.mock_calls[0][1][4], - {'Content-Type': 'application/json'}) - - @patch.object(petstore_api.ApiClient, 'call_api') - def test_call_with_forced_content_type(self, mock_call_api): - # force content-type - self.pet_api.add_pet(self.pet, _content_type='application/xml') - mock_call_api.assert_called_once() - # check if content-type is used - self.assertEqual(mock_call_api.mock_calls[0][1][4], - {'Content-Type': 'application/xml'}) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior/tests/test_serialization.py b/samples/client/petstore/python-prior/tests/test_serialization.py deleted file mode 100644 index 1f718ecca6b5..000000000000 --- a/samples/client/petstore/python-prior/tests/test_serialization.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import os -import time -import unittest -import datetime - -import six - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) -from petstore_api.model import ( - enum_test, - pet, - animal, - dog, - parent_pet, - child_lizard, - category, - string_enum, - string_boolean_map, -) -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -from petstore_api.rest import RESTResponse - -MockResponse = namedtuple('MockResponse', 'data') - -class SerializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.serialize = self.api_client.sanitize_for_serialization - - def test_enum_test(self): - """ serialize dict(str, Enum_Test) """ - value = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) - string_enum_val = string_enum.StringEnum(value) - - source = enum_test.EnumTest( - enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - string_enum=string_enum_val - ) - - result = { - 'enum_test': { - "enum_string": "UPPER", - "enum_string_required": "lower", - "enum_integer": 1, - "enum_number": 1.1, - "stringEnum": "placed" - } - } - serialized = self.serialize({"enum_test": source}) - - self.assertEqual(result, serialized) diff --git a/samples/client/petstore/python-prior/tests/test_store_api.py b/samples/client/petstore/python-prior/tests/test_store_api.py deleted file mode 100644 index a7c1d5dd6670..000000000000 --- a/samples/client/petstore/python-prior/tests/test_store_api.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAP/Petstore-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi - - -class StoreApiTests(unittest.TestCase): - - def setUp(self): - self.store_api = StoreApi() - - def tearDown(self): - # sleep 1 sec between two every 2 tests - time.sleep(1) - - def test_get_inventory(self): - data = self.store_api.get_inventory() - self.assertIsNotNone(data) - self.assertTrue(isinstance(data, dict)) diff --git a/samples/client/petstore/python-prior/tests/util.py b/samples/client/petstore/python-prior/tests/util.py deleted file mode 100644 index 113d7dcc5478..000000000000 --- a/samples/client/petstore/python-prior/tests/util.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) diff --git a/samples/client/petstore/python-prior/tox.ini b/samples/client/petstore/python-prior/tox.ini deleted file mode 100644 index 8989fc3c4d96..000000000000 --- a/samples/client/petstore/python-prior/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml deleted file mode 100644 index 9e84f5176163..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.tests: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests - image: python:3.7-alpine -test-3.8: - extends: .tests - image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES deleted file mode 100644 index 9ea159533683..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES +++ /dev/null @@ -1,173 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnimalFarm.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/Child.md -docs/ChildAllOf.md -docs/ChildCat.md -docs/ChildCatAllOf.md -docs/ChildDog.md -docs/ChildDogAllOf.md -docs/ChildLizard.md -docs/ChildLizardAllOf.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/Grandparent.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/NumberWithValidations.md -docs/ObjectModelWithRefProps.md -docs/Order.md -docs/Parent.md -docs/ParentAllOf.md -docs/ParentPet.md -docs/Pet.md -docs/PetApi.md -docs/Player.md -docs/Polygon.md -docs/PolygonAllOf.md -docs/ReadOnlyFirst.md -docs/Shape.md -docs/SpecialModelName.md -docs/Square.md -docs/SquareAllOf.md -docs/StoreApi.md -docs/StringBooleanMap.md -docs/StringEnum.md -docs/Tag.md -docs/Triangle.md -docs/TriangleAllOf.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/apis/__init__.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/model/__init__.py -petstore_api/model/additional_properties_any_type.py -petstore_api/model/additional_properties_array.py -petstore_api/model/additional_properties_boolean.py -petstore_api/model/additional_properties_class.py -petstore_api/model/additional_properties_integer.py -petstore_api/model/additional_properties_number.py -petstore_api/model/additional_properties_object.py -petstore_api/model/additional_properties_string.py -petstore_api/model/animal.py -petstore_api/model/animal_farm.py -petstore_api/model/api_response.py -petstore_api/model/array_of_array_of_number_only.py -petstore_api/model/array_of_number_only.py -petstore_api/model/array_test.py -petstore_api/model/capitalization.py -petstore_api/model/cat.py -petstore_api/model/cat_all_of.py -petstore_api/model/category.py -petstore_api/model/child.py -petstore_api/model/child_all_of.py -petstore_api/model/child_cat.py -petstore_api/model/child_cat_all_of.py -petstore_api/model/child_dog.py -petstore_api/model/child_dog_all_of.py -petstore_api/model/child_lizard.py -petstore_api/model/child_lizard_all_of.py -petstore_api/model/class_model.py -petstore_api/model/client.py -petstore_api/model/dog.py -petstore_api/model/dog_all_of.py -petstore_api/model/enum_arrays.py -petstore_api/model/enum_class.py -petstore_api/model/enum_test.py -petstore_api/model/file.py -petstore_api/model/file_schema_test_class.py -petstore_api/model/format_test.py -petstore_api/model/grandparent.py -petstore_api/model/grandparent_animal.py -petstore_api/model/has_only_read_only.py -petstore_api/model/list.py -petstore_api/model/map_test.py -petstore_api/model/mixed_properties_and_additional_properties_class.py -petstore_api/model/model200_response.py -petstore_api/model/model_return.py -petstore_api/model/name.py -petstore_api/model/number_only.py -petstore_api/model/number_with_validations.py -petstore_api/model/object_model_with_ref_props.py -petstore_api/model/order.py -petstore_api/model/parent.py -petstore_api/model/parent_all_of.py -petstore_api/model/parent_pet.py -petstore_api/model/pet.py -petstore_api/model/player.py -petstore_api/model/polygon.py -petstore_api/model/polygon_all_of.py -petstore_api/model/read_only_first.py -petstore_api/model/shape.py -petstore_api/model/special_model_name.py -petstore_api/model/square.py -petstore_api/model/square_all_of.py -petstore_api/model/string_boolean_map.py -petstore_api/model/string_enum.py -petstore_api/model/tag.py -petstore_api/model/triangle.py -petstore_api/model/triangle_all_of.py -petstore_api/model/type_holder_default.py -petstore_api/model/type_holder_example.py -petstore_api/model/user.py -petstore_api/model/xml_item.py -petstore_api/model_utils.py -petstore_api/models/__init__.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml deleted file mode 100644 index 1fcc4b155964..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile deleted file mode 100644 index a6bbba4a434f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test: clean - bash ./test_python.sh diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md deleted file mode 100644 index ba6cb7bbf8d1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md +++ /dev/null @@ -1,257 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen - -## Requirements. - -Python >=3.6 - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python - -import time -import petstore_api -from pprint import pprint -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [Child](docs/Child.md) - - [ChildAllOf](docs/ChildAllOf.md) - - [ChildCat](docs/ChildCat.md) - - [ChildCatAllOf](docs/ChildCatAllOf.md) - - [ChildDog](docs/ChildDog.md) - - [ChildDogAllOf](docs/ChildDogAllOf.md) - - [ChildLizard](docs/ChildLizard.md) - - [ChildLizardAllOf](docs/ChildLizardAllOf.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [Grandparent](docs/Grandparent.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [NumberWithValidations](docs/NumberWithValidations.md) - - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [Order](docs/Order.md) - - [Parent](docs/Parent.md) - - [ParentAllOf](docs/ParentAllOf.md) - - [ParentPet](docs/ParentPet.md) - - [Pet](docs/Pet.md) - - [Player](docs/Player.md) - - [Polygon](docs/Polygon.md) - - [PolygonAllOf](docs/PolygonAllOf.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Shape](docs/Shape.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Square](docs/Square.md) - - [SquareAllOf](docs/SquareAllOf.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [StringEnum](docs/StringEnum.md) - - [Tag](docs/Tag.md) - - [Triangle](docs/Triangle.md) - - [TriangleAllOf](docs/TriangleAllOf.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -## Author - - - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from petstore_api.api.default_api import DefaultApi` -- `from petstore_api.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import petstore_api -from petstore_api.apis import * -from petstore_api.models import * -``` - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index d31d12de0822..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesAnyType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 40537cbf8384..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesArray - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index bf7b5be4c13d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesBoolean - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md deleted file mode 100644 index fe54cef0539f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_string** | **{str: (str,)}** | | [optional] -**map_number** | **{str: (float,)}** | | [optional] -**map_integer** | **{str: (int,)}** | | [optional] -**map_boolean** | **{str: (bool,)}** | | [optional] -**map_array_integer** | **{str: ([int],)}** | | [optional] -**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}** | | [optional] -**map_map_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}** | | [optional] -**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] -**anytype_2** | **bool, date, datetime, dict, float, int, list, str, none_type** | no type is set for this | [optional] -**anytype_3** | **bool, date, datetime, dict, float, int, list, str, none_type** | because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378 | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 96345efd4cc8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 9af52dc6dcfd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesNumber - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **float** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md deleted file mode 100644 index dc64a0d91c24..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type,)}** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md deleted file mode 100644 index fe3993d02265..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesString - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **str** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md deleted file mode 100644 index 1d1c77c01abc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] if omitted the server will use the default value of "red" - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md deleted file mode 100644 index fc299cf27d34..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md +++ /dev/null @@ -1,11 +0,0 @@ -# AnimalFarm - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**[Animal]**](Animal.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md deleted file mode 100644 index d2d58609c8be..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md +++ /dev/null @@ -1,78 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(body) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md deleted file mode 100644 index 81a7d0d85227..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 6ab77963788b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **[[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md deleted file mode 100644 index ebc65a54ba7e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md deleted file mode 100644 index 4e1bda8fc3af..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **[str]** | | [optional] -**array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md deleted file mode 100644 index 1ddeadeb3f46..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md deleted file mode 100644 index e9ce235cd632..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md +++ /dev/null @@ -1,13 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**declawed** | **bool** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md deleted file mode 100644 index 0ff7809a99ac..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md deleted file mode 100644 index 940f6a45e641..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | defaults to "default-name" -**id** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md deleted file mode 100644 index eb4392445710..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md +++ /dev/null @@ -1,13 +0,0 @@ -# Child - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] -**tele_vision** | **bool** | | [optional] -**inter_net** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md deleted file mode 100644 index f9ae99c7c157..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChildAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inter_net** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md deleted file mode 100644 index 9e3a0fb4b51a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md deleted file mode 100644 index c5883b9a87c8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChildCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md deleted file mode 100644 index 9a6e5b372664..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildDog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**bark** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md deleted file mode 100644 index 673050667cb3..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChildDogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bark** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md deleted file mode 100644 index e881ee0a1d1b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildLizard - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**loves_rocks** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md deleted file mode 100644 index 6e2b70c01505..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChildLizardAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loves_rocks** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md deleted file mode 100644 index 48ed7cbf2ff0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md deleted file mode 100644 index c3986008d6c3..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md deleted file mode 100644 index 7065c4c983d9..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md +++ /dev/null @@ -1,13 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**breed** | **str** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md deleted file mode 100644 index 6382bbd80671..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md deleted file mode 100644 index 9be5c645a809..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md deleted file mode 100644 index a1f9aae58190..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md deleted file mode 100644 index eb8842241390..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string_required** | **str** | | -**enum_string** | **str** | | [optional] -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md deleted file mode 100644 index cef1d93c186a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md +++ /dev/null @@ -1,1239 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -[**string**](FakeApi.md#string) | **POST** /fake/refs/string | -[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **array_model** -> AnimalFarm array_model() - - - -Test serialization of ArrayModel - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.animal_farm import AnimalFarm -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = AnimalFarm([ - Animal(), - ]) # AnimalFarm | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.array_model(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] - -### Return type - -[**AnimalFarm**](AnimalFarm.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **boolean** -> bool boolean() - - - -Test serialization of outer boolean types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.boolean(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->boolean: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_xml_item** -> create_xml_item(xml_item) - -creates an XmlItem - -this route creates an XmlItem - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.xml_item import XmlItem -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - xml_item = XmlItem( - attribute_string="string", - attribute_number=1.234, - attribute_integer=-2, - attribute_boolean=True, - wrapped_array=[ - 1, - ], - name_string="string", - name_number=1.234, - name_integer=-2, - name_boolean=True, - name_array=[ - 1, - ], - name_wrapped_array=[ - 1, - ], - prefix_string="string", - prefix_number=1.234, - prefix_integer=-2, - prefix_boolean=True, - prefix_array=[ - 1, - ], - prefix_wrapped_array=[ - 1, - ], - namespace_string="string", - namespace_number=1.234, - namespace_integer=-2, - namespace_boolean=True, - namespace_array=[ - 1, - ], - namespace_wrapped_array=[ - 1, - ], - prefix_ns_string="string", - prefix_ns_number=1.234, - prefix_ns_integer=-2, - prefix_ns_boolean=True, - prefix_ns_array=[ - 1, - ], - prefix_ns_wrapped_array=[ - 1, - ], - ) # XmlItem | XmlItem Body - - # example passing only required values which don't have defaults set - try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **number_with_validations** -> NumberWithValidations number_with_validations() - - - -Test serialization of outer number types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.number_with_validations import NumberWithValidations -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = NumberWithValidations(1E+1) # NumberWithValidations | Input number as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.number_with_validations(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->number_with_validations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] - -### Return type - -[**NumberWithValidations**](NumberWithValidations.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **object_model_with_ref_props** -> ObjectModelWithRefProps object_model_with_ref_props() - - - -Test serialization of object with $refed properties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = ObjectModelWithRefProps( - my_number=NumberWithValidations(1E+1), - my_string="my_string_example", - my_boolean=True, - ) # ObjectModelWithRefProps | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.object_model_with_ref_props(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] - -### Return type - -[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string** -> str string() - - - -Test serialization of outer string types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = "body_example" # str | Input string as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string_enum** -> StringEnum string_enum() - - - -Test serialization of outer enum - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.string_enum import StringEnum -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = StringEnum("placed") # StringEnum | Input enum (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string_enum(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string_enum: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] - -### Return type - -[**StringEnum**](StringEnum.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output enum | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = FileSchemaTestClass( - file=File( - source_uri="source_uri_example", - ), - files=[ - File( - source_uri="source_uri_example", - ), - ], - ) # FileSchemaTestClass | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_file_schema(body) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, body) - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - query = "query_example" # str | - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_query_params(query, body) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(body) - -To test \"client\" model - -To test \"client\" model - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_enums_length_one** -> test_endpoint_enums_length_one() - - - -This route has required values with enums of 1 - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example passing only required values which don't have defaults set - try: - api_instance.test_endpoint_enums_length_one() - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query_integer** | **int**| | defaults to 3 - **query_string** | **str**| | defaults to "brillig" - **path_string** | **str**| | defaults to "hello" - **path_integer** | **int**| | defaults to 34 - **header_number** | **float**| | defaults to 1.234 - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - number = 32.1 # float | None - double = 67.8 # float | None - pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>" # str | None - byte = 'YQ==' # str | None - integer = 10 # int | None (optional) - int32 = 20 # int | None (optional) - int64 = 1 # int | None (optional) - float = 3.14 # float | None (optional) - string = "A" # str | None (optional) - binary = open('/path/to/file', 'rb') # file_type | None (optional) - date = dateutil_parser('1970-01-01').date() # date | None (optional) - date_time = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | None (optional) - password = "password_example" # str | None (optional) - param_callback = "param_callback_example" # str | None (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file_type**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters() - -To test enum parameters - -To test enum parameters - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - enum_header_string_array = [ - "$", - ] # [str] | Header parameter enum test (string array) (optional) - enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_string_array = [ - "$", - ] # [str] | Query parameter enum test (string array) (optional) - enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_integer = 1 # int | Query parameter enum test (double) (optional) - enum_query_double = 1.1 # float | Query parameter enum test (double) (optional) - enum_form_string_array = [ - "$", - ] # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$" - enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - - # example passing only required values which don't have defaults set - # and optional values - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$" - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - required_string_group = 1 # int | Required String in group parameters - required_boolean_group = True # bool | Required Boolean in group parameters - required_int64_group = 1 # int | Required Integer in group parameters - string_group = 1 # int | String in group parameters (optional) - boolean_group = True # bool | Boolean in group parameters (optional) - int64_group = 1 # int | Integer in group parameters (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(param) - -test inline additionalProperties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - param = { - "key": "key_example", - } # {str: (str,)} | request body - - # example passing only required values which don't have defaults set - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **{str: (str,)}**| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - param = "param_example" # str | field1 - param2 = "param2_example" # str | field2 - - # example passing only required values which don't have defaults set - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 411d4bb4b745..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,89 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(body) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): - -```python -import time -import petstore_api -from petstore_api.api import fake_classname_tags123_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) - body = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md deleted file mode 100644 index 63b1d1a65186..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md +++ /dev/null @@ -1,12 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md deleted file mode 100644 index caf2440821da..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md deleted file mode 100644 index aef09bfcc83e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md +++ /dev/null @@ -1,23 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | | -**byte** | **str** | | -**date** | **date** | | -**password** | **str** | | -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**binary** | **file_type** | | [optional] -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md deleted file mode 100644 index b6d80a719457..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md +++ /dev/null @@ -1,11 +0,0 @@ -# Grandparent - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md deleted file mode 100644 index 15db0708bb1a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md +++ /dev/null @@ -1,11 +0,0 @@ -# GrandparentAnimal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md deleted file mode 100644 index 0e1334519a8b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md deleted file mode 100644 index 4b60956971aa..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md deleted file mode 100644 index 15228ee1f282..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_of_enum_string** | **{str: (str,)}** | | [optional] -**direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f489944a20af..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md deleted file mode 100644 index c958bd4b33f8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md deleted file mode 100644 index 043e9d466fab..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md deleted file mode 100644 index 4fd119d12515..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md deleted file mode 100644 index 674c441551b3..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md deleted file mode 100644 index 3be719cdbfba..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md +++ /dev/null @@ -1,15 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md deleted file mode 100644 index 37195c5d8994..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md deleted file mode 100644 index 119e0f678239..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberWithValidations - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md deleted file mode 100644 index 5ff4e52033d6..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md +++ /dev/null @@ -1,14 +0,0 @@ -# ObjectModelWithRefProps - -a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md deleted file mode 100644 index d29e1a381de8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] if omitted the server will use the default value of False - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md deleted file mode 100644 index 9d3f02d68b31..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md +++ /dev/null @@ -1,12 +0,0 @@ -# Parent - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**radio_waves** | **bool** | | [optional] -**tele_vision** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md deleted file mode 100644 index 569a5e4af14f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# ParentAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tele_vision** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md deleted file mode 100644 index 09e409c8fcf1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md +++ /dev/null @@ -1,11 +0,0 @@ -# ParentPet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md deleted file mode 100644 index 6e78495272e4..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**photo_urls** | **[str]** | | -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md deleted file mode 100644 index 70252451912d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md +++ /dev/null @@ -1,802 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(body) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - full_name="full_name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Add a new pet to the store - api_instance.add_pet(body) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | Pet id to delete - api_key = "api_key_example" # str | (optional) - - # example passing only required values which don't have defaults set - try: - # Deletes a pet - api_instance.delete_pet(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> [Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - status = [ - "available", - ] # [str] | Status values that need to be considered for filter - - # example passing only required values which don't have defaults set - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **[str]**| Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> [Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - tags = [ - "tags_example", - ] # [str] | Tags to filter by - - # example passing only required values which don't have defaults set - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | **[str]**| Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to return - - # example passing only required values which don't have defaults set - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(body) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - body = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - full_name="full_name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Update an existing pet - api_instance.update_pet(body) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet that needs to be updated - name = "name_example" # str | Updated name of the pet (optional) - status = "status_example" # str | Updated status of the pet (optional) - - # example passing only required values which don't have defaults set - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to update - additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) - file = open('/path/to/file', 'rb') # file_type | file to upload (optional) - files = [ -null, - ] # [file_type] | files to upload (optional) - - # example passing only required values which don't have defaults set - try: - # uploads an image - api_response = api_instance.upload_file(pet_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file_type**| file to upload | [optional] - **files** | **[file_type]**| files to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to update - required_file = open('/path/to/file', 'rb') # file_type | file to upload - additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) - - # example passing only required values which don't have defaults set - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file_type**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md deleted file mode 100644 index 2014198aa1bd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md +++ /dev/null @@ -1,12 +0,0 @@ -# Player - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**enemy_player** | [**Player**](Player.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md deleted file mode 100644 index ee26d74fab62..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md +++ /dev/null @@ -1,13 +0,0 @@ -# Polygon - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**area** | **str** | | [optional] -**sides** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md deleted file mode 100644 index af335e0da304..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# PolygonAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**sides** | **int** | | [optional] -**area** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md deleted file mode 100644 index 53b4c61d8445..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md deleted file mode 100644 index d6ec61ccba2b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md +++ /dev/null @@ -1,12 +0,0 @@ -# Shape - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | -**area** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md deleted file mode 100644 index 268e1134192d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md deleted file mode 100644 index f1e5416fb796..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md +++ /dev/null @@ -1,13 +0,0 @@ -# Square - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | defaults to "Square" -**area** | **str** | | [optional] -**sides** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md deleted file mode 100644 index 0aee3fc5201e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# SquareAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | [optional] if omitted the server will use the default value of "Square" -**sides** | **int** | | [optional] -**area** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md deleted file mode 100644 index 95a40cf27acd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md +++ /dev/null @@ -1,293 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = "order_id_example" # str | ID of the order that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> {str: (int,)} get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (int,)}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = 1 # int | ID of pet that needs to be fetched - - # example passing only required values which don't have defaults set - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(body) - -Place an order for a pet - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - body = Order( - id=1, - pet_id=1, - quantity=1, - ship_date=dateutil_parser('1970-01-01T00:00:00.00Z'), - status="placed", - complete=False, - ) # Order | order placed for purchasing the pet - - # example passing only required values which don't have defaults set - try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md deleted file mode 100644 index 217c79704081..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringBooleanMap - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md deleted file mode 100644 index bb195ec0e453..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["placed", "approved", "delivered", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md deleted file mode 100644 index b9fe1e0944c4..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md +++ /dev/null @@ -1,13 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] -**full_name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md deleted file mode 100644 index 84770cd63f87..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md +++ /dev/null @@ -1,13 +0,0 @@ -# Triangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | defaults to "Triangle" -**area** | **str** | | [optional] -**sides** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md deleted file mode 100644 index 4bd5a6970206..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# TriangleAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | | [optional] if omitted the server will use the default value of "Triangle" -**sides** | **int** | | [optional] -**area** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md deleted file mode 100644 index 904915aec010..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md +++ /dev/null @@ -1,18 +0,0 @@ -# TypeHolderDefault - -a model to test optional properties with server defaults - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_item** | **[int]** | | -**string_item** | **str** | | defaults to "what" -**number_item** | **float** | | defaults to 1.234 -**integer_item** | **int** | | defaults to -2 -**bool_item** | **bool** | | defaults to True -**date_item** | **date** | | [optional] -**datetime_item** | **datetime** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md deleted file mode 100644 index d2954c64dcef..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeHolderExample - -a model to test required properties with an example and length one enum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bool_item** | **bool** | | -**array_item** | **[int]** | | -**string_item** | **str** | | defaults to "what" -**number_item** | **float** | | defaults to 1.234 -**integer_item** | **int** | | defaults to -2 - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md deleted file mode 100644 index b0079f591b6e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md deleted file mode 100644 index 9f90c838493a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md +++ /dev/null @@ -1,578 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(body) - -Create user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | Created user object - - # example passing only required values which don't have defaults set - try: - # Create user - api_instance.create_user(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(body) - -Creates list of users with given input array - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(body) - -Creates list of users with given input array - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - body = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete user - api_instance.delete_user(username) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be fetched. Use user1 for testing. - - # example passing only required values which don't have defaults set - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The user name for login - password = "password_example" # str | The password for login in clear text - - # example passing only required values which don't have defaults set - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Logs out current logged in user session - api_instance.logout_user() - except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | name that need to be deleted - body = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - ) # User | Updated user object - - # example passing only required values which don't have defaults set - try: - # Updated user - api_instance.update_user(username, body) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md deleted file mode 100644 index ea3d7f92804b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md +++ /dev/null @@ -1,39 +0,0 @@ -# XmlItem - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **str** | | [optional] -**attribute_number** | **float** | | [optional] -**attribute_integer** | **int** | | [optional] -**attribute_boolean** | **bool** | | [optional] -**wrapped_array** | **[int]** | | [optional] -**name_string** | **str** | | [optional] -**name_number** | **float** | | [optional] -**name_integer** | **int** | | [optional] -**name_boolean** | **bool** | | [optional] -**name_array** | **[int]** | | [optional] -**name_wrapped_array** | **[int]** | | [optional] -**prefix_string** | **str** | | [optional] -**prefix_number** | **float** | | [optional] -**prefix_integer** | **int** | | [optional] -**prefix_boolean** | **bool** | | [optional] -**prefix_array** | **[int]** | | [optional] -**prefix_wrapped_array** | **[int]** | | [optional] -**namespace_string** | **str** | | [optional] -**namespace_number** | **float** | | [optional] -**namespace_integer** | **int** | | [optional] -**namespace_boolean** | **bool** | | [optional] -**namespace_array** | **[int]** | | [optional] -**namespace_wrapped_array** | **[int]** | | [optional] -**prefix_ns_string** | **str** | | [optional] -**prefix_ns_number** | **float** | | [optional] -**prefix_ns_integer** | **int** | | [optional] -**prefix_ns_boolean** | **bool** | | [optional] -**prefix_ns_array** | **[int]** | | [optional] -**prefix_ns_wrapped_array** | **[int]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py deleted file mode 100644 index 26dd6f84e215..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from petstore_api.api_client import ApiClient - -# import Configuration -from petstore_api.configuration import Configuration - -# import exceptions -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py deleted file mode 100644 index 840e9f0cd908..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from petstore_api.apis import AnotherFakeApi diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py deleted file mode 100644 index d54ded04e311..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,171 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/another-fake/dummy', - 'operation_id': 'call_123_test_special_tags', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py deleted file mode 100644 index 98536575b077..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2464 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.client import Client -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.user import User -from petstore_api.model.xml_item import XmlItem - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.array_model_endpoint = _Endpoint( - settings={ - 'response_type': (AnimalFarm,), - 'auth': [], - 'endpoint_path': '/fake/refs/arraymodel', - 'operation_id': 'array_model', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (AnimalFarm,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.boolean_endpoint = _Endpoint( - settings={ - 'response_type': (bool,), - 'auth': [], - 'endpoint_path': '/fake/refs/boolean', - 'operation_id': 'boolean', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (bool,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.create_xml_item_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/create_xml_item', - 'operation_id': 'create_xml_item', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'xml_item', - ], - 'required': [ - 'xml_item', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'xml_item': - (XmlItem,), - }, - 'attribute_map': { - }, - 'location_map': { - 'xml_item': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/xml', - 'application/xml; charset=utf-8', - 'application/xml; charset=utf-16', - 'text/xml', - 'text/xml; charset=utf-8', - 'text/xml; charset=utf-16' - ] - }, - api_client=api_client - ) - self.number_with_validations_endpoint = _Endpoint( - settings={ - 'response_type': (NumberWithValidations,), - 'auth': [], - 'endpoint_path': '/fake/refs/number', - 'operation_id': 'number_with_validations', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (NumberWithValidations,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.object_model_with_ref_props_endpoint = _Endpoint( - settings={ - 'response_type': (ObjectModelWithRefProps,), - 'auth': [], - 'endpoint_path': '/fake/refs/object_model_with_ref_props', - 'operation_id': 'object_model_with_ref_props', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (ObjectModelWithRefProps,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.string_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/fake/refs/string', - 'operation_id': 'string', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (str,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.string_enum_endpoint = _Endpoint( - settings={ - 'response_type': (StringEnum,), - 'auth': [], - 'endpoint_path': '/fake/refs/enum', - 'operation_id': 'string_enum', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (StringEnum,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.test_body_with_file_schema_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-file-schema', - 'operation_id': 'test_body_with_file_schema', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (FileSchemaTestClass,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_body_with_query_params_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-query-params', - 'operation_id': 'test_body_with_query_params', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'query', - 'body', - ], - 'required': [ - 'query', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'query': - (str,), - 'body': - (User,), - }, - 'attribute_map': { - 'query': 'query', - }, - 'location_map': { - 'query': 'query', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_client_model_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_client_model', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_endpoint_enums_length_one_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}', - 'operation_id': 'test_endpoint_enums_length_one', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'required': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'nullable': [ - ], - 'enum': [ - 'query_integer', - 'query_string', - 'path_string', - 'path_integer', - 'header_number', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('query_integer',): { - - "3": 3 - }, - ('query_string',): { - - "BRILLIG": "brillig" - }, - ('path_string',): { - - "HELLO": "hello" - }, - ('path_integer',): { - - "34": 34 - }, - ('header_number',): { - - "1.234": 1.234 - }, - }, - 'openapi_types': { - 'query_integer': - (int,), - 'query_string': - (str,), - 'path_string': - (str,), - 'path_integer': - (int,), - 'header_number': - (float,), - }, - 'attribute_map': { - 'query_integer': 'query_integer', - 'query_string': 'query_string', - 'path_string': 'path_string', - 'path_integer': 'path_integer', - 'header_number': 'header_number', - }, - 'location_map': { - 'query_integer': 'query', - 'query_string': 'query', - 'path_string': 'path', - 'path_integer': 'path', - 'header_number': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.test_endpoint_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'http_basic_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_endpoint_parameters', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback', - ], - 'required': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'integer', - 'int32', - 'float', - 'string', - 'password', - ] - }, - root_map={ - 'validations': { - ('number',): { - - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('double',): { - - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('pattern_without_delimiter',): { - - 'regex': { - 'pattern': r'^[A-Z].*', # noqa: E501 - }, - }, - ('integer',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - - 'inclusive_maximum': 987.6, - }, - ('string',): { - - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'number': - (float,), - 'double': - (float,), - 'pattern_without_delimiter': - (str,), - 'byte': - (str,), - 'integer': - (int,), - 'int32': - (int,), - 'int64': - (int,), - 'float': - (float,), - 'string': - (str,), - 'binary': - (file_type,), - 'date': - (date,), - 'date_time': - (datetime,), - 'password': - (str,), - 'param_callback': - (str,), - }, - 'attribute_map': { - 'number': 'number', - 'double': 'double', - 'pattern_without_delimiter': 'pattern_without_delimiter', - 'byte': 'byte', - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'float': 'float', - 'string': 'string', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'password': 'password', - 'param_callback': 'callback', - }, - 'location_map': { - 'number': 'form', - 'double': 'form', - 'pattern_without_delimiter': 'form', - 'byte': 'form', - 'integer': 'form', - 'int32': 'form', - 'int64': 'form', - 'float': 'form', - 'string': 'form', - 'binary': 'form', - 'date': 'form', - 'date_time': 'form', - 'password': 'form', - 'param_callback': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_enum_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_enum_parameters', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('enum_header_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_header_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_query_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_integer',): { - - "1": 1, - "-2": -2 - }, - ('enum_query_double',): { - - "1.1": 1.1, - "-1.2": -1.2 - }, - ('enum_form_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_form_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - }, - 'openapi_types': { - 'enum_header_string_array': - ([str],), - 'enum_header_string': - (str,), - 'enum_query_string_array': - ([str],), - 'enum_query_string': - (str,), - 'enum_query_integer': - (int,), - 'enum_query_double': - (float,), - 'enum_form_string_array': - ([str],), - 'enum_form_string': - (str,), - }, - 'attribute_map': { - 'enum_header_string_array': 'enum_header_string_array', - 'enum_header_string': 'enum_header_string', - 'enum_query_string_array': 'enum_query_string_array', - 'enum_query_string': 'enum_query_string', - 'enum_query_integer': 'enum_query_integer', - 'enum_query_double': 'enum_query_double', - 'enum_form_string_array': 'enum_form_string_array', - 'enum_form_string': 'enum_form_string', - }, - 'location_map': { - 'enum_header_string_array': 'header', - 'enum_header_string': 'header', - 'enum_query_string_array': 'query', - 'enum_query_string': 'query', - 'enum_query_integer': 'query', - 'enum_query_double': 'query', - 'enum_form_string_array': 'form', - 'enum_form_string': 'form', - }, - 'collection_format_map': { - 'enum_header_string_array': 'csv', - 'enum_query_string_array': 'csv', - 'enum_form_string_array': 'csv', - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_group_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_group_parameters', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group', - ], - 'required': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'required_string_group': - (int,), - 'required_boolean_group': - (bool,), - 'required_int64_group': - (int,), - 'string_group': - (int,), - 'boolean_group': - (bool,), - 'int64_group': - (int,), - }, - 'attribute_map': { - 'required_string_group': 'required_string_group', - 'required_boolean_group': 'required_boolean_group', - 'required_int64_group': 'required_int64_group', - 'string_group': 'string_group', - 'boolean_group': 'boolean_group', - 'int64_group': 'int64_group', - }, - 'location_map': { - 'required_string_group': 'query', - 'required_boolean_group': 'header', - 'required_int64_group': 'query', - 'string_group': 'query', - 'boolean_group': 'header', - 'int64_group': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.test_inline_additional_properties_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/inline-additionalProperties', - 'operation_id': 'test_inline_additional_properties', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'param', - ], - 'required': [ - 'param', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': - ({str: (str,)},), - }, - 'attribute_map': { - }, - 'location_map': { - 'param': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_json_form_data_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/jsonFormData', - 'operation_id': 'test_json_form_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'param', - 'param2', - ], - 'required': [ - 'param', - 'param2', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': - (str,), - 'param2': - (str,), - }, - 'attribute_map': { - 'param': 'param', - 'param2': 'param2', - }, - 'location_map': { - 'param': 'form', - 'param2': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['xml_item'] = \ - xml_item - return self.create_xml_item_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['param'] = \ - param - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index e6abced84092..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index 69537296f488..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py deleted file mode 100644 index af164a6ce79c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1306 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.pet import Pet - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.add_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'add_pet', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.delete_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'delete_pet', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'api_key', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'api_key': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'api_key': 'api_key', - }, - 'location_map': { - 'pet_id': 'path', - 'api_key': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_status_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByStatus', - 'operation_id': 'find_pets_by_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'status', - ], - 'required': [ - 'status', - ], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('status',): { - - "AVAILABLE": "available", - "PENDING": "pending", - "SOLD": "sold" - }, - }, - 'openapi_types': { - 'status': - ([str],), - }, - 'attribute_map': { - 'status': 'status', - }, - 'location_map': { - 'status': 'query', - }, - 'collection_format_map': { - 'status': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_tags_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByTags', - 'operation_id': 'find_pets_by_tags', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'tags', - ], - 'required': [ - 'tags', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'tags': - ([str],), - }, - 'attribute_map': { - 'tags': 'tags', - }, - 'location_map': { - 'tags': 'query', - }, - 'collection_format_map': { - 'tags': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_pet_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Pet,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'get_pet_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - }, - 'attribute_map': { - 'pet_id': 'petId', - }, - 'location_map': { - 'pet_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'update_pet', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.update_pet_with_form_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'update_pet_with_form', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'name', - 'status', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'name': - (str,), - 'status': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'name': 'name', - 'status': 'status', - }, - 'location_map': { - 'pet_id': 'path', - 'name': 'form', - 'status': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.upload_file_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}/uploadImage', - 'operation_id': 'upload_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'additional_metadata', - 'file', - 'files', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'additional_metadata': - (str,), - 'file': - (file_type,), - 'files': - ([file_type],), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'additional_metadata': 'additionalMetadata', - 'file': 'file', - 'files': 'files', - }, - 'location_map': { - 'pet_id': 'path', - 'additional_metadata': 'form', - 'file': 'form', - 'files': 'form', - }, - 'collection_format_map': { - 'files': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.upload_file_with_required_file_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', - 'operation_id': 'upload_file_with_required_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'required_file', - 'additional_metadata', - ], - 'required': [ - 'pet_id', - 'required_file', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'required_file': - (file_type,), - 'additional_metadata': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'required_file': 'requiredFile', - 'additional_metadata': 'additionalMetadata', - }, - 'location_map': { - 'pet_id': 'path', - 'required_file': 'form', - 'additional_metadata': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - - def add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py deleted file mode 100644 index d171adfb3a06..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ /dev/null @@ -1,560 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.order import Order - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.delete_order_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'delete_order', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (str,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_inventory_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (int,)},), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/store/inventory', - 'operation_id': 'get_inventory', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_order_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'get_order_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'order_id', - ] - }, - root_map={ - 'validations': { - ('order_id',): { - - 'inclusive_maximum': 5, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (int,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.place_order_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order', - 'operation_id': 'place_order', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (Order,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py deleted file mode 100644 index 5f3964342921..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ /dev/null @@ -1,1083 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.user import User - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user', - 'operation_id': 'create_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (User,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.create_users_with_array_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithArray', - 'operation_id': 'create_users_with_array_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.create_users_with_list_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithList', - 'operation_id': 'create_users_with_list_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.delete_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'delete_user', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_user_by_name_endpoint = _Endpoint( - settings={ - 'response_type': (User,), - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'get_user_by_name', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.login_user_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/user/login', - 'operation_id': 'login_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'password', - ], - 'required': [ - 'username', - 'password', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'password': - (str,), - }, - 'attribute_map': { - 'username': 'username', - 'password': 'password', - }, - 'location_map': { - 'username': 'query', - 'password': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.logout_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/logout', - 'operation_id': 'logout_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.update_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'update_user', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'body', - ], - 'required': [ - 'username', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'body': - (User,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - - def create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.update_user_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py deleted file mode 100644 index 3c9e7a5f68dd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ /dev/null @@ -1,898 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField - - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException -from petstore_api.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return (return_data) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, list): - return [cls.sanitize_for_serialization(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(cls.sanitize_for_serialization(item) for item in obj) - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - 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'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = AnotherFakeApi() - api_instance.call_123_test_special_tags # this is an instance of the class Endpoint - api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.call_123_test_special_tags.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] - ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py deleted file mode 100644 index 5ccd49eec8e0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from petstore_api.api.another_fake_api import AnotherFakeApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py deleted file mode 100644 index 06a3179ad375..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py +++ /dev/null @@ -1,518 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://petstore.swagger.io:80/v2", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py deleted file mode 100644 index d223cb4876ce..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py +++ /dev/null @@ -1,158 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py deleted file mode 100644 index 027452f37a87..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# 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 petstore_api.models import ModelA, ModelB diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py deleted file mode 100644 index 2d0c78c0ae19..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesAnyType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py deleted file mode 100644 index 462219270afc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesArray(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ([bool, date, datetime, dict, float, int, list, str, none_type],) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py deleted file mode 100644 index 7f3132131878..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesBoolean(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py deleted file mode 100644 index f241a1296c99..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'map_string': ({str: (str,)},), # noqa: E501 - 'map_number': ({str: (float,)},), # noqa: E501 - 'map_integer': ({str: (int,)},), # noqa: E501 - 'map_boolean': ({str: (bool,)},), # noqa: E501 - 'map_array_integer': ({str: ([int],)},), # noqa: E501 - 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)},), # noqa: E501 - 'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)},), # noqa: E501 - 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'anytype_2': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'anytype_3': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_string': 'map_string', # noqa: E501 - 'map_number': 'map_number', # noqa: E501 - 'map_integer': 'map_integer', # noqa: E501 - 'map_boolean': 'map_boolean', # noqa: E501 - 'map_array_integer': 'map_array_integer', # noqa: E501 - 'map_array_anytype': 'map_array_anytype', # noqa: E501 - 'map_map_string': 'map_map_string', # noqa: E501 - 'map_map_anytype': 'map_map_anytype', # noqa: E501 - 'anytype_1': 'anytype_1', # noqa: E501 - 'anytype_2': 'anytype_2', # noqa: E501 - 'anytype_3': 'anytype_3', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_string ({str: (str,)}): [optional] # noqa: E501 - map_number ({str: (float,)}): [optional] # noqa: E501 - map_integer ({str: (int,)}): [optional] # noqa: E501 - map_boolean ({str: (bool,)}): [optional] # noqa: E501 - map_array_integer ({str: ([int],)}): [optional] # noqa: E501 - map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 - map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 - anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_string ({str: (str,)}): [optional] # noqa: E501 - map_number ({str: (float,)}): [optional] # noqa: E501 - map_integer ({str: (int,)}): [optional] # noqa: E501 - map_boolean ({str: (bool,)}): [optional] # noqa: E501 - map_array_integer ({str: ([int],)}): [optional] # noqa: E501 - map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501 - map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501 - anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py deleted file mode 100644 index 880a80c1a868..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesInteger(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (int,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py deleted file mode 100644 index 79b1fc5e219f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesNumber(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (float,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py deleted file mode 100644 index f7afe571d71b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesObject(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py deleted file mode 100644 index c7dff4d382f4..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesString(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (str,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py deleted file mode 100644 index 8304f57dbfc8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.cat import Cat - from petstore_api.model.dog import Dog - globals()['Cat'] = Cat - globals()['Dog'] = Dog - - -class Animal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Cat': Cat, - 'Dog': Dog, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py deleted file mode 100644 index 89062cff69cb..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class AnimalFarm(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([Animal],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py deleted file mode 100644 index 84a3c0f08cea..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py +++ /dev/null @@ -1,265 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ApiResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'code': (int,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'code': 'code', # noqa: E501 - 'type': 'type', # noqa: E501 - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py deleted file mode 100644 index 35ac0a1e03c7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_array_number': ([[float]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py deleted file mode 100644 index 14785b2f4d50..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_number': ([float],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_number': 'ArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py deleted file mode 100644 index 20cc5749c7fa..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py +++ /dev/null @@ -1,270 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.read_only_first import ReadOnlyFirst - globals()['ReadOnlyFirst'] = ReadOnlyFirst - - -class ArrayTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_of_string': ([str],), # noqa: E501 - 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_of_string': 'array_of_string', # noqa: E501 - 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py deleted file mode 100644 index f08efa83487c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Capitalization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'small_camel': (str,), # noqa: E501 - 'capital_camel': (str,), # noqa: E501 - 'small_snake': (str,), # noqa: E501 - 'capital_snake': (str,), # noqa: E501 - 'sca_eth_flow_points': (str,), # noqa: E501 - 'att_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'small_camel': 'smallCamel', # noqa: E501 - 'capital_camel': 'CapitalCamel', # noqa: E501 - 'small_snake': 'small_Snake', # noqa: E501 - 'capital_snake': 'Capital_Snake', # noqa: E501 - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py deleted file mode 100644 index 57917bf29fca..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.cat_all_of import CatAllOf - globals()['Animal'] = Animal - globals()['CatAllOf'] = CatAllOf - - -class Cat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'declawed': (bool,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'declawed': 'declawed', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - CatAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py deleted file mode 100644 index 671e9b545de7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class CatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'declawed': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'declawed': 'declawed', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py deleted file mode 100644 index e3452f7c3aef..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Category(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'id': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'id': 'id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py deleted file mode 100644 index f0906314bbf1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py +++ /dev/null @@ -1,323 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_all_of import ChildAllOf - from petstore_api.model.parent import Parent - globals()['ChildAllOf'] = ChildAllOf - globals()['Parent'] = Parent - - -class Child(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'radio_waves': (bool,), # noqa: E501 - 'tele_vision': (bool,), # noqa: E501 - 'inter_net': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - 'tele_vision': 'teleVision', # noqa: E501 - 'inter_net': 'interNet', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Child - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Child - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildAllOf, - Parent, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py deleted file mode 100644 index 86dbe76aee22..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'inter_net': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'inter_net': 'interNet', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - inter_net (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py deleted file mode 100644 index 610da6e1c6c9..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat_all_of import ChildCatAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCatAllOf'] = ChildCatAllOf - globals()['ParentPet'] = ParentPet - - -class ChildCat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildCatAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py deleted file mode 100644 index 80389884a8f3..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildCatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py deleted file mode 100644 index dd51694625dc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_dog_all_of import ChildDogAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildDogAllOf'] = ChildDogAllOf - globals()['ParentPet'] = ParentPet - - -class ChildDog(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'bark': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'bark': 'bark', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildDog - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildDog - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildDogAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py deleted file mode 100644 index 5a3cefff372d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildDogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bark': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bark': 'bark', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildDogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildDogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bark (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py deleted file mode 100644 index 61bc109ff830..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_lizard_all_of import ChildLizardAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildLizardAllOf'] = ChildLizardAllOf - globals()['ParentPet'] = ParentPet - - -class ChildLizard(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'loves_rocks': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'loves_rocks': 'lovesRocks', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildLizard - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildLizard - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildLizardAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py deleted file mode 100644 index 39150e0533cf..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildLizardAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'loves_rocks': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'loves_rocks': 'lovesRocks', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildLizardAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildLizardAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - loves_rocks (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py deleted file mode 100644 index 1a424d5a46d0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ClassModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_class': '_class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py deleted file mode 100644 index 0c0db8a6c723..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Client(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'client': 'client', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py deleted file mode 100644 index 7039aa3e6f45..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.dog_all_of import DogAllOf - globals()['Animal'] = Animal - globals()['DogAllOf'] = DogAllOf - - -class Dog(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'breed': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'breed': 'breed', # noqa: E501 - 'color': 'color', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - DogAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py deleted file mode 100644 index 541db2ddd101..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class DogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'breed': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'breed': 'breed', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py deleted file mode 100644 index 0bb3ef17f4c6..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumArrays(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('just_symbol',): { - '>=': ">=", - '$': "$", - }, - ('array_enum',): { - 'FISH': "fish", - 'CRAB': "crab", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_symbol': (str,), # noqa: E501 - 'array_enum': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py deleted file mode 100644 index bf9b682bd05d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumClass(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py deleted file mode 100644 index f935dd5c7db1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py +++ /dev/null @@ -1,302 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_enum import StringEnum - globals()['StringEnum'] = StringEnum - - -class EnumTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('enum_string_required',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_integer',): { - '1': 1, - '-1': -1, - }, - ('enum_number',): { - '1.1': 1.1, - '-1.2': -1.2, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'enum_string_required': (str,), # noqa: E501 - 'enum_string': (str,), # noqa: E501 - 'enum_integer': (int,), # noqa: E501 - 'enum_number': (float,), # noqa: E501 - 'string_enum': (StringEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'enum_string_required': 'enum_string_required', # noqa: E501 - 'enum_string': 'enum_string', # noqa: E501 - 'enum_integer': 'enum_integer', # noqa: E501 - 'enum_number': 'enum_number', # noqa: E501 - 'string_enum': 'stringEnum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py deleted file mode 100644 index cc6f56f744c2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class File(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'source_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'source_uri': 'sourceURI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py deleted file mode 100644 index feabb50e960a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py +++ /dev/null @@ -1,266 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.file import File - globals()['File'] = File - - -class FileSchemaTestClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'file': (File,), # noqa: E501 - 'files': ([File],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'file': 'file', # noqa: E501 - 'files': 'files', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py deleted file mode 100644 index 745fba3d79d1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py +++ /dev/null @@ -1,352 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class FormatTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('byte',): { - 'regex': { - 'pattern': r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', # noqa: E501 - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - 'inclusive_maximum': 987.6, - 'inclusive_minimum': 54.3, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'^[a-z]+$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'number': (float,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'uuid': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'number': 'number', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'date': 'date', # noqa: E501 - 'password': 'password', # noqa: E501 - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'uuid': 'uuid', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py deleted file mode 100644 index 5ee6a938ef99..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Grandparent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'radio_waves': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Grandparent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Grandparent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py deleted file mode 100644 index c70dd5a668d6..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.child_dog import ChildDog - from petstore_api.model.child_lizard import ChildLizard - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCat'] = ChildCat - globals()['ChildDog'] = ChildDog - globals()['ChildLizard'] = ChildLizard - globals()['ParentPet'] = ParentPet - - -class GrandparentAnimal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ChildDog': ChildDog, - 'ChildLizard': ChildLizard, - 'ParentPet': ParentPet, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py deleted file mode 100644 index 8073662194b2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class HasOnlyReadOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'foo': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'foo': 'foo', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - 'foo', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py deleted file mode 100644 index e25bdf99070c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class List(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_123_list': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_123_list': '123-list', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py deleted file mode 100644 index 76774b1cb14e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py +++ /dev/null @@ -1,278 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_boolean_map import StringBooleanMap - globals()['StringBooleanMap'] = StringBooleanMap - - -class MapTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('map_of_enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_of_enum_string': ({str: (str,)},), # noqa: E501 - 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (StringBooleanMap,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', # noqa: E501 - 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 - 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 20318287b5cc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,270 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'uuid': (str,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (Animal,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'uuid': 'uuid', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'map': 'map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py deleted file mode 100644 index 68b59f875c12..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py +++ /dev/null @@ -1,261 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py deleted file mode 100644 index 0163993dc53c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py +++ /dev/null @@ -1,261 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model_200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py deleted file mode 100644 index 026a7084affd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ModelReturn(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_return': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_return': 'return', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py deleted file mode 100644 index 9327b59e5519..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Name(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - 'snake_case': (int,), # noqa: E501 - '_property': (str,), # noqa: E501 - '_123_number': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'snake_case': 'snake_case', # noqa: E501 - '_property': 'property', # noqa: E501 - '_123_number': '123Number', # noqa: E501 - } - - read_only_vars = { - 'snake_case', # noqa: E501 - '_123_number', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py deleted file mode 100644 index 383c7068cdd5..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_number': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_number': 'JustNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py deleted file mode 100644 index ba4e371b4ac0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py +++ /dev/null @@ -1,290 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberWithValidations(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('value',): { - 'inclusive_maximum': 2E+1, - 'inclusive_minimum': 1E+1, - }, - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (float,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py deleted file mode 100644 index 58201d4a406d..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py +++ /dev/null @@ -1,270 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.number_with_validations import NumberWithValidations - globals()['NumberWithValidations'] = NumberWithValidations - - -class ObjectModelWithRefProps(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'my_number': (NumberWithValidations,), # noqa: E501 - 'my_string': (str,), # noqa: E501 - 'my_boolean': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'my_number': 'my_number', # noqa: E501 - 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py deleted file mode 100644 index 16e35d5eb3cc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Order(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'pet_id': (int,), # noqa: E501 - 'quantity': (int,), # noqa: E501 - 'ship_date': (datetime,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'complete': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'pet_id': 'petId', # noqa: E501 - 'quantity': 'quantity', # noqa: E501 - 'ship_date': 'shipDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'complete': 'complete', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py deleted file mode 100644 index 08bb8af4ae6f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.grandparent import Grandparent - from petstore_api.model.parent_all_of import ParentAllOf - globals()['Grandparent'] = Grandparent - globals()['ParentAllOf'] = ParentAllOf - - -class Parent(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'radio_waves': (bool,), # noqa: E501 - 'tele_vision': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'radio_waves': 'radioWaves', # noqa: E501 - 'tele_vision': 'teleVision', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Parent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Parent - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - radio_waves (bool): [optional] # noqa: E501 - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Grandparent, - ParentAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py deleted file mode 100644 index 6eb1b6d1c2c7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ParentAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'tele_vision': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'tele_vision': 'teleVision', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tele_vision (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py deleted file mode 100644 index d29d3b27adbd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.child_dog import ChildDog - from petstore_api.model.child_lizard import ChildLizard - from petstore_api.model.grandparent_animal import GrandparentAnimal - globals()['ChildCat'] = ChildCat - globals()['ChildDog'] = ChildDog - globals()['ChildLizard'] = ChildLizard - globals()['GrandparentAnimal'] = GrandparentAnimal - - -class ParentPet(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ChildDog': ChildDog, - 'ChildLizard': ChildLizard, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - GrandparentAnimal, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py deleted file mode 100644 index 433e0f3984b1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - globals()['Category'] = Category - globals()['Tag'] = Tag - - -class Pet(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'AVAILABLE': "available", - 'PENDING': "pending", - 'SOLD': "sold", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'photo_urls': ([str],), # noqa: E501 - 'id': (int,), # noqa: E501 - 'category': (Category,), # noqa: E501 - 'tags': ([Tag],), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 - 'id': 'id', # noqa: E501 - 'category': 'category', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py deleted file mode 100644 index 57322e4c8dba..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Player(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'enemy_player': (Player,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'enemy_player': 'enemyPlayer', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Player - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enemy_player (Player): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Player - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enemy_player (Player): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py deleted file mode 100644 index 5cb7b464fe05..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon_all_of import PolygonAllOf - from petstore_api.model.shape import Shape - globals()['PolygonAllOf'] = PolygonAllOf - globals()['Shape'] = Shape - - -class Polygon(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Polygon - a model defined in OpenAPI - - Keyword Args: - type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Polygon - a model defined in OpenAPI - - Keyword Args: - type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - PolygonAllOf, - Shape, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py deleted file mode 100644 index 69f646b3c4de..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py +++ /dev/null @@ -1,275 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class PolygonAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """PolygonAllOf - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """PolygonAllOf - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py deleted file mode 100644 index 5931aa9b6d3a..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py +++ /dev/null @@ -1,262 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ReadOnlyFirst(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'baz': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'baz': 'baz', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py deleted file mode 100644 index e6b84303dc76..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py +++ /dev/null @@ -1,271 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Shape(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - 'SQUARE': "Square", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py deleted file mode 100644 index 94bb3aeb12ad..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py +++ /dev/null @@ -1,257 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SpecialModelName(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'special_property_name': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'special_property_name': '$special[property.name]', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py deleted file mode 100644 index f402fd735610..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py +++ /dev/null @@ -1,328 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon import Polygon - from petstore_api.model.square_all_of import SquareAllOf - globals()['Polygon'] = Polygon - globals()['SquareAllOf'] = SquareAllOf - - -class Square(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SQUARE': "Square", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Square - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Square", must be one of ["Square", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Square") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Square - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Square", must be one of ["Square", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Square") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Polygon, - SquareAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py deleted file mode 100644 index ad3f3fb1e934..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SquareAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SQUARE': "Square", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SquareAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Square" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SquareAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Square" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py deleted file mode 100644 index 52b6f39964bd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py +++ /dev/null @@ -1,259 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringBooleanMap(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py deleted file mode 100644 index 5b8b59620b16..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py deleted file mode 100644 index 4f909a39c872..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py +++ /dev/null @@ -1,265 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Tag(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'full_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'full_name': 'fullName', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - full_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - full_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py deleted file mode 100644 index 34029a961fdb..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py +++ /dev/null @@ -1,328 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.polygon import Polygon - from petstore_api.model.triangle_all_of import TriangleAllOf - globals()['Polygon'] = Polygon - globals()['TriangleAllOf'] = TriangleAllOf - - -class Triangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'area': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'area': 'area', # noqa: E501 - 'sides': 'sides', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Triangle", must be one of ["Triangle", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Triangle") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - type (str): defaults to "Triangle", must be one of ["Triangle", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - area (str): [optional] # noqa: E501 - sides (int): [optional] # noqa: E501 - """ - - type = kwargs.get('type', "Triangle") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Polygon, - TriangleAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py deleted file mode 100644 index 00802c74d366..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TriangleAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TRIANGLE': "Triangle", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'sides': (int,), # noqa: E501 - 'area': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'sides': 'sides', # noqa: E501 - 'area': 'area', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TriangleAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Triangle" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TriangleAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] if omitted the server will use the default value of "Triangle" # noqa: E501 - sides (int): [optional] # noqa: E501 - area (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py deleted file mode 100644 index 09ea0b0a100e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TypeHolderDefault(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'string_item': (str,), # noqa: E501 - 'number_item': (float,), # noqa: E501 - 'integer_item': (int,), # noqa: E501 - 'bool_item': (bool,), # noqa: E501 - 'array_item': ([int],), # noqa: E501 - 'date_item': (date,), # noqa: E501 - 'datetime_item': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string_item': 'string_item', # noqa: E501 - 'number_item': 'number_item', # noqa: E501 - 'integer_item': 'integer_item', # noqa: E501 - 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 - 'date_item': 'date_item', # noqa: E501 - 'datetime_item': 'datetime_item', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI - - Args: - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what" # noqa: E501 - number_item (float): defaults to 1.234 # noqa: E501 - integer_item (int): defaults to -2 # noqa: E501 - bool_item (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - date_item (date): [optional] # noqa: E501 - datetime_item (datetime): [optional] # noqa: E501 - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - bool_item = kwargs.get('bool_item', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI - - Args: - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what" # noqa: E501 - number_item (float): defaults to 1.234 # noqa: E501 - integer_item (int): defaults to -2 # noqa: E501 - bool_item (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - date_item (date): [optional] # noqa: E501 - datetime_item (datetime): [optional] # noqa: E501 - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - bool_item = kwargs.get('bool_item', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py deleted file mode 100644 index aaa2f5747c74..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py +++ /dev/null @@ -1,302 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TypeHolderExample(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('string_item',): { - 'WHAT': "what", - }, - ('number_item',): { - '1.234': 1.234, - }, - ('integer_item',): { - '-2': -2, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'string_item': (str,), # noqa: E501 - 'number_item': (float,), # noqa: E501 - 'integer_item': (int,), # noqa: E501 - 'bool_item': (bool,), # noqa: E501 - 'array_item': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string_item': 'string_item', # noqa: E501 - 'number_item': 'number_item', # noqa: E501 - 'integer_item': 'integer_item', # noqa: E501 - 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, bool_item, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI - - Args: - bool_item (bool): - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what", must be one of ["what", ] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI - - Args: - bool_item (bool): - array_item ([int]): - - Keyword Args: - string_item (str): defaults to "what", must be one of ["what", ] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - string_item = kwargs.get('string_item', "what") - number_item = kwargs.get('number_item', 1.234) - integer_item = kwargs.get('integer_item', -2) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py deleted file mode 100644 index f57d763ed04f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py +++ /dev/null @@ -1,285 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'username': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'user_status': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'username': 'username', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'email': 'email', # noqa: E501 - 'password': 'password', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py deleted file mode 100644 index e7cee17e4d61..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py +++ /dev/null @@ -1,369 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class XmlItem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'attribute_string': (str,), # noqa: E501 - 'attribute_number': (float,), # noqa: E501 - 'attribute_integer': (int,), # noqa: E501 - 'attribute_boolean': (bool,), # noqa: E501 - 'wrapped_array': ([int],), # noqa: E501 - 'name_string': (str,), # noqa: E501 - 'name_number': (float,), # noqa: E501 - 'name_integer': (int,), # noqa: E501 - 'name_boolean': (bool,), # noqa: E501 - 'name_array': ([int],), # noqa: E501 - 'name_wrapped_array': ([int],), # noqa: E501 - 'prefix_string': (str,), # noqa: E501 - 'prefix_number': (float,), # noqa: E501 - 'prefix_integer': (int,), # noqa: E501 - 'prefix_boolean': (bool,), # noqa: E501 - 'prefix_array': ([int],), # noqa: E501 - 'prefix_wrapped_array': ([int],), # noqa: E501 - 'namespace_string': (str,), # noqa: E501 - 'namespace_number': (float,), # noqa: E501 - 'namespace_integer': (int,), # noqa: E501 - 'namespace_boolean': (bool,), # noqa: E501 - 'namespace_array': ([int],), # noqa: E501 - 'namespace_wrapped_array': ([int],), # noqa: E501 - 'prefix_ns_string': (str,), # noqa: E501 - 'prefix_ns_number': (float,), # noqa: E501 - 'prefix_ns_integer': (int,), # noqa: E501 - 'prefix_ns_boolean': (bool,), # noqa: E501 - 'prefix_ns_array': ([int],), # noqa: E501 - 'prefix_ns_wrapped_array': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'attribute_string': 'attribute_string', # noqa: E501 - 'attribute_number': 'attribute_number', # noqa: E501 - 'attribute_integer': 'attribute_integer', # noqa: E501 - 'attribute_boolean': 'attribute_boolean', # noqa: E501 - 'wrapped_array': 'wrapped_array', # noqa: E501 - 'name_string': 'name_string', # noqa: E501 - 'name_number': 'name_number', # noqa: E501 - 'name_integer': 'name_integer', # noqa: E501 - 'name_boolean': 'name_boolean', # noqa: E501 - 'name_array': 'name_array', # noqa: E501 - 'name_wrapped_array': 'name_wrapped_array', # noqa: E501 - 'prefix_string': 'prefix_string', # noqa: E501 - 'prefix_number': 'prefix_number', # noqa: E501 - 'prefix_integer': 'prefix_integer', # noqa: E501 - 'prefix_boolean': 'prefix_boolean', # noqa: E501 - 'prefix_array': 'prefix_array', # noqa: E501 - 'prefix_wrapped_array': 'prefix_wrapped_array', # noqa: E501 - 'namespace_string': 'namespace_string', # noqa: E501 - 'namespace_number': 'namespace_number', # noqa: E501 - 'namespace_integer': 'namespace_integer', # noqa: E501 - 'namespace_boolean': 'namespace_boolean', # noqa: E501 - 'namespace_array': 'namespace_array', # noqa: E501 - 'namespace_wrapped_array': 'namespace_wrapped_array', # noqa: E501 - 'prefix_ns_string': 'prefix_ns_string', # noqa: E501 - 'prefix_ns_number': 'prefix_ns_number', # noqa: E501 - 'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501 - 'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501 - 'prefix_ns_array': 'prefix_ns_array', # noqa: E501 - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """XmlItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - attribute_string (str): [optional] # noqa: E501 - attribute_number (float): [optional] # noqa: E501 - attribute_integer (int): [optional] # noqa: E501 - attribute_boolean (bool): [optional] # noqa: E501 - wrapped_array ([int]): [optional] # noqa: E501 - name_string (str): [optional] # noqa: E501 - name_number (float): [optional] # noqa: E501 - name_integer (int): [optional] # noqa: E501 - name_boolean (bool): [optional] # noqa: E501 - name_array ([int]): [optional] # noqa: E501 - name_wrapped_array ([int]): [optional] # noqa: E501 - prefix_string (str): [optional] # noqa: E501 - prefix_number (float): [optional] # noqa: E501 - prefix_integer (int): [optional] # noqa: E501 - prefix_boolean (bool): [optional] # noqa: E501 - prefix_array ([int]): [optional] # noqa: E501 - prefix_wrapped_array ([int]): [optional] # noqa: E501 - namespace_string (str): [optional] # noqa: E501 - namespace_number (float): [optional] # noqa: E501 - namespace_integer (int): [optional] # noqa: E501 - namespace_boolean (bool): [optional] # noqa: E501 - namespace_array ([int]): [optional] # noqa: E501 - namespace_wrapped_array ([int]): [optional] # noqa: E501 - prefix_ns_string (str): [optional] # noqa: E501 - prefix_ns_number (float): [optional] # noqa: E501 - prefix_ns_integer (int): [optional] # noqa: E501 - prefix_ns_boolean (bool): [optional] # noqa: E501 - prefix_ns_array ([int]): [optional] # noqa: E501 - prefix_ns_wrapped_array ([int]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """XmlItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - attribute_string (str): [optional] # noqa: E501 - attribute_number (float): [optional] # noqa: E501 - attribute_integer (int): [optional] # noqa: E501 - attribute_boolean (bool): [optional] # noqa: E501 - wrapped_array ([int]): [optional] # noqa: E501 - name_string (str): [optional] # noqa: E501 - name_number (float): [optional] # noqa: E501 - name_integer (int): [optional] # noqa: E501 - name_boolean (bool): [optional] # noqa: E501 - name_array ([int]): [optional] # noqa: E501 - name_wrapped_array ([int]): [optional] # noqa: E501 - prefix_string (str): [optional] # noqa: E501 - prefix_number (float): [optional] # noqa: E501 - prefix_integer (int): [optional] # noqa: E501 - prefix_boolean (bool): [optional] # noqa: E501 - prefix_array ([int]): [optional] # noqa: E501 - prefix_wrapped_array ([int]): [optional] # noqa: E501 - namespace_string (str): [optional] # noqa: E501 - namespace_number (float): [optional] # noqa: E501 - namespace_integer (int): [optional] # noqa: E501 - namespace_boolean (bool): [optional] # noqa: E501 - namespace_array ([int]): [optional] # noqa: E501 - namespace_wrapped_array ([int]): [optional] # noqa: E501 - prefix_ns_string (str): [optional] # noqa: E501 - prefix_ns_number (float): [optional] # noqa: E501 - prefix_ns_integer (int): [optional] # noqa: E501 - prefix_ns_boolean (bool): [optional] # noqa: E501 - prefix_ns_array ([int]): [optional] # noqa: E501 - prefix_ns_wrapped_array ([int]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py deleted file mode 100644 index ab2d0087dfa0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py +++ /dev/null @@ -1,2058 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from petstore_api.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - 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 variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - 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 variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - 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: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - 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( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py deleted file mode 100644 index 2fd471f464e0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py +++ /dev/null @@ -1,81 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from petstore_api.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.model.additional_properties_array import AdditionalPropertiesArray -from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.model.additional_properties_object import AdditionalPropertiesObject -from petstore_api.model.additional_properties_string import AdditionalPropertiesString -from petstore_api.model.animal import Animal -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly -from petstore_api.model.array_test import ArrayTest -from petstore_api.model.capitalization import Capitalization -from petstore_api.model.cat import Cat -from petstore_api.model.cat_all_of import CatAllOf -from petstore_api.model.category import Category -from petstore_api.model.child import Child -from petstore_api.model.child_all_of import ChildAllOf -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.child_cat_all_of import ChildCatAllOf -from petstore_api.model.child_dog import ChildDog -from petstore_api.model.child_dog_all_of import ChildDogAllOf -from petstore_api.model.child_lizard import ChildLizard -from petstore_api.model.child_lizard_all_of import ChildLizardAllOf -from petstore_api.model.class_model import ClassModel -from petstore_api.model.client import Client -from petstore_api.model.dog import Dog -from petstore_api.model.dog_all_of import DogAllOf -from petstore_api.model.enum_arrays import EnumArrays -from petstore_api.model.enum_class import EnumClass -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.file import File -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.format_test import FormatTest -from petstore_api.model.grandparent import Grandparent -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api.model.has_only_read_only import HasOnlyReadOnly -from petstore_api.model.list import List -from petstore_api.model.map_test import MapTest -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.model.model200_response import Model200Response -from petstore_api.model.model_return import ModelReturn -from petstore_api.model.name import Name -from petstore_api.model.number_only import NumberOnly -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.order import Order -from petstore_api.model.parent import Parent -from petstore_api.model.parent_all_of import ParentAllOf -from petstore_api.model.parent_pet import ParentPet -from petstore_api.model.pet import Pet -from petstore_api.model.player import Player -from petstore_api.model.polygon import Polygon -from petstore_api.model.polygon_all_of import PolygonAllOf -from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api.model.shape import Shape -from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.square import Square -from petstore_api.model.square_all_of import SquareAllOf -from petstore_api.model.string_boolean_map import StringBooleanMap -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.tag import Tag -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_all_of import TriangleAllOf -from petstore_api.model.type_holder_default import TypeHolderDefault -from petstore_api.model.type_holder_example import TypeHolderExample -from petstore_api.model.user import User -from petstore_api.model.xml_item import XmlItem diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py deleted file mode 100644 index b66d8497bad2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re -import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment -import urllib3 -import ipaddress - -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml deleted file mode 100644 index 1db0285b1812..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonV2PetstoreClientTestsDisallowAdditionalPropertiesIfNotPresent - pom - 1.0-SNAPSHOT - Python OpenAPI Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test - - - - - - - - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt deleted file mode 100644 index 96947f60408f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py deleted file mode 100644 index c484eec94f36..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.6", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt deleted file mode 100644 index bb4f22bb7a6e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest-cov>=2.8.1 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py deleted file mode 100644 index ce985f76ed9e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType - - -class TestAdditionalPropertiesAnyType(unittest.TestCase): - """AdditionalPropertiesAnyType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesAnyType(self): - """Test AdditionalPropertiesAnyType""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesAnyType() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py deleted file mode 100644 index f63ca82f6c22..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_array import AdditionalPropertiesArray - - -class TestAdditionalPropertiesArray(unittest.TestCase): - """AdditionalPropertiesArray unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesArray(self): - """Test AdditionalPropertiesArray""" - # can make model without additional properties - model = AdditionalPropertiesArray() - - # can make one with additional properties - import datetime - some_val = [] - model = AdditionalPropertiesArray(some_key=some_val) - assert model['some_key'] == some_val - some_val = [True, datetime.date(1970,1,1), datetime.datetime(1970,1,1), {}, 3.1, 1, [], 'hello'] - model = AdditionalPropertiesArray(some_key=some_val) - assert model['some_key'] == some_val - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesArray(some_key='some string') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py deleted file mode 100644 index e5a13891c098..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean - - -class TestAdditionalPropertiesBoolean(unittest.TestCase): - """AdditionalPropertiesBoolean unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesBoolean(self): - """Test AdditionalPropertiesBoolean""" - # can make model without additional properties - model = AdditionalPropertiesBoolean() - - # can make one with additional properties - model = AdditionalPropertiesBoolean(some_key=True) - assert model['some_key'] == True - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesBoolean(some_key='True') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py deleted file mode 100644 index befc14455da2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py deleted file mode 100644 index 0e08b8f87706..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger - - -class TestAdditionalPropertiesInteger(unittest.TestCase): - """AdditionalPropertiesInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesInteger(self): - """Test AdditionalPropertiesInteger""" - # can make model without additional properties - model = AdditionalPropertiesInteger() - - # can make one with additional properties - model = AdditionalPropertiesInteger(some_key=3) - assert model['some_key'] == 3 - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesInteger(some_key=11.3) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py deleted file mode 100644 index 90f4429e989f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber - - -class TestAdditionalPropertiesNumber(unittest.TestCase): - """AdditionalPropertiesNumber unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesNumber(self): - """Test AdditionalPropertiesNumber""" - # can make model without additional properties - model = AdditionalPropertiesNumber() - - # can make one with additional properties - model = AdditionalPropertiesNumber(some_key=11.3) - assert model['some_key'] == 11.3 - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesNumber(some_key=10) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py deleted file mode 100644 index ded4a8e8a124..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_object import AdditionalPropertiesObject - - -class TestAdditionalPropertiesObject(unittest.TestCase): - """AdditionalPropertiesObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesObject(self): - """Test AdditionalPropertiesObject""" - # can make model without additional properties - model = AdditionalPropertiesObject() - - # can make one with additional properties - some_val = {} - model = AdditionalPropertiesObject(some_key=some_val) - assert model['some_key'] == some_val - import datetime - some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'} - model = AdditionalPropertiesObject(some_key=some_val) - assert model['some_key'] == some_val - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesObject(some_key='some string') - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py deleted file mode 100644 index cff2c31921fe..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_string import AdditionalPropertiesString - - -class TestAdditionalPropertiesString(unittest.TestCase): - """AdditionalPropertiesString unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesString(self): - """Test AdditionalPropertiesString""" - # can make model without additional properties - model = AdditionalPropertiesString() - - # can make one with additional properties - model = AdditionalPropertiesString(some_key='some_val') - assert model['some_key'] == 'some_val' - - # type checking works on additional properties - with self.assertRaises(petstore_api.ApiTypeError) as exc: - model = AdditionalPropertiesString(some_key=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py deleted file mode 100644 index 958f303f13e3..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] -from petstore_api.model.animal import Animal - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py deleted file mode 100644 index 7117d42b430e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -from petstore_api.model.animal_farm import AnimalFarm - - -class TestAnimalFarm(unittest.TestCase): - """AnimalFarm unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimalFarm(self): - """Test AnimalFarm""" - # FIXME: construct object with mandatory attributes with example values - # model = AnimalFarm() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py deleted file mode 100644 index f79966a26961..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_call_123_test_special_tags(self): - """Test case for call_123_test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py deleted file mode 100644 index 9db92633f626..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.api_response import ApiResponse - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py deleted file mode 100644 index 4980ad17afb5..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py deleted file mode 100644 index 479c537cada7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py deleted file mode 100644 index 2426b27b7e46..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] -from petstore_api.model.array_test import ArrayTest - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py deleted file mode 100644 index 20d2649c01eb..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.capitalization import Capitalization - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py deleted file mode 100644 index 64b525aaf118..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] -from petstore_api.model.cat import Cat - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py deleted file mode 100644 index a5bb91ac864e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.cat_all_of import CatAllOf - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py deleted file mode 100644 index 59b64e5924a8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.category import Category - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py deleted file mode 100644 index 790fc1abc8da..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_all_of -except ImportError: - child_all_of = sys.modules[ - 'petstore_api.model.child_all_of'] -try: - from petstore_api.model import parent -except ImportError: - parent = sys.modules[ - 'petstore_api.model.parent'] -from petstore_api.model.child import Child - - -class TestChild(unittest.TestCase): - """Child unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChild(self): - """Test Child - This will fail because additional_properties_type is None in ChildAllOf and it must be defined as any type - to allow in the property radio_waves which is not defined in ChildAllOf, it is defined in Grandparent - """ - # make an instance of Child, a composed schema model - radio_waves = True - tele_vision = True - inter_net = True - with self.assertRaises(petstore_api.exceptions.ApiValueError): - child = Child( - radio_waves=radio_waves, - tele_vision=tele_vision, - inter_net=inter_net - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py deleted file mode 100644 index 96e479cf0796..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_all_of import ChildAllOf - - -class TestChildAllOf(unittest.TestCase): - """ChildAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildAllOf(self): - """Test ChildAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py deleted file mode 100644 index 34c085515a80..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_cat import ChildCat - - -class TestChildCat(unittest.TestCase): - """ChildCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCat(self): - """Test ChildCat""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py deleted file mode 100644 index 2a7aab100fbf..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat_all_of import ChildCatAllOf - - -class TestChildCatAllOf(unittest.TestCase): - """ChildCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCatAllOf(self): - """Test ChildCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py deleted file mode 100644 index dfb09213e40c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_dog_all_of -except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.model.child_dog_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_dog import ChildDog - - -class TestChildDog(unittest.TestCase): - """ChildDog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildDog(self): - """Test ChildDog""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildDog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py deleted file mode 100644 index ca75000c650e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_dog_all_of import ChildDogAllOf - - -class TestChildDogAllOf(unittest.TestCase): - """ChildDogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildDogAllOf(self): - """Test ChildDogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildDogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py deleted file mode 100644 index 975dc1612a9f..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_lizard_all_of -except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.model.child_lizard_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.child_lizard import ChildLizard - - -class TestChildLizard(unittest.TestCase): - """ChildLizard unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildLizard(self): - """Test ChildLizard""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildLizard() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py deleted file mode 100644 index 1b3bf4dba943..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.child_lizard_all_of import ChildLizardAllOf - - -class TestChildLizardAllOf(unittest.TestCase): - """ChildLizardAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildLizardAllOf(self): - """Test ChildLizardAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildLizardAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py deleted file mode 100644 index 060df39e4b5e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.class_model import ClassModel - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py deleted file mode 100644 index ab5e3a80d377..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.client import Client - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py deleted file mode 100644 index 9fb96ebc6b92..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] -from petstore_api.model.dog import Dog - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog - This will fail because additional_properties_type is None in Animal and it must be defined as any type - to allow in the property breed which is not defined in Animal, it is defined in Dog - """ - # make an instance of dog, a composed schema model - class_name = 'Dog' - color = 'white' - breed = 'Jack Russel Terrier' - with self.assertRaises(petstore_api.exceptions.ApiValueError): - dog = Dog( - class_name=class_name, - color=color, - breed=breed - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py deleted file mode 100644 index 7ab4e8ae79d8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.dog_all_of import DogAllOf - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py deleted file mode 100644 index 64ad5fd7dc08..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_arrays import EnumArrays - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_enumarrays_init(self): - # - # Check various combinations of valid values. - # - fish_or_crab = EnumArrays(just_symbol=">=") - self.assertEqual(fish_or_crab.just_symbol, ">=") - # if optional property is unset we raise an exception - with self.assertRaises(petstore_api.ApiAttributeError) as exc: - self.assertEqual(fish_or_crab.array_enum, None) - - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, ">=") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - - # - # Check if setting invalid values fails - # - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab = EnumArrays(just_symbol="<=") - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"]) - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"]) - - - def test_enumarrays_setter(self): - - # - # Check various combinations of valid values - # - fish_or_crab = EnumArrays() - - fish_or_crab.just_symbol = ">=" - self.assertEqual(fish_or_crab.just_symbol, ">=") - - fish_or_crab.just_symbol = "$" - self.assertEqual(fish_or_crab.just_symbol, "$") - - fish_or_crab.array_enum = [] - self.assertEqual(fish_or_crab.array_enum, []) - - fish_or_crab.array_enum = ["fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab.array_enum = ["fish", "fish", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) - - fish_or_crab.array_enum = ["crab"] - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - fish_or_crab.array_enum = ["crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) - - fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) - - # - # Check if setting invalid values fails - # - fish_or_crab = EnumArrays() - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.just_symbol = "!=" - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab.just_symbol = ["fish"] - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.array_enum = ["cat"] - - with self.assertRaises(petstore_api.ApiValueError) as exc: - fish_or_crab.array_enum = ["fish", "crab", "dog"] - - with self.assertRaises(petstore_api.ApiTypeError) as exc: - fish_or_crab.array_enum = "fish" - - - def test_todict(self): - # - # Check if dictionary serialization works - # - dollar_fish_crab_dict = { - 'just_symbol': "$", - 'array_enum': ["fish", "crab"] - } - - dollar_fish_crab = EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) - - # - # Sanity check for different arrays - # - dollar_crab_fish_dict = { - 'just_symbol': "$", - 'array_enum': ["crab", "fish"] - } - - dollar_fish_crab = EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) - - - def test_equals(self): - # - # Check if object comparison works - # - fish1 = EnumArrays(just_symbol="$", array_enum=["fish"]) - fish2 = EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish1, fish2) - - fish = EnumArrays(just_symbol="$", array_enum=["fish"]) - crab = EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertNotEqual(fish, crab) - - dollar = EnumArrays(just_symbol="$") - greater = EnumArrays(just_symbol=">=") - self.assertNotEqual(dollar, greater) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py deleted file mode 100644 index f910231c9d02..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_class import EnumClass - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py deleted file mode 100644 index 7b4c1b6b66ac..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] -from petstore_api.model.enum_test import EnumTest - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py deleted file mode 100644 index d5ea58566103..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_xml_item(self): - """Test case for create_xml_item - - creates an XmlItem # noqa: E501 - """ - pass - - def test_boolean(self): - """Test case for boolean - - """ - endpoint = self.api.boolean_endpoint - assert endpoint.openapi_types['body'] == (bool,) - assert endpoint.settings['response_type'] == (bool,) - - def test_string(self): - """Test case for string - - """ - endpoint = self.api.string_endpoint - assert endpoint.openapi_types['body'] == (str,) - assert endpoint.settings['response_type'] == (str,) - - def test_object_model_with_ref_props(self): - """Test case for object_model_with_ref_props - - """ - from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props_endpoint - assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) - assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) - - def test_string_enum(self): - """Test case for string_enum - - """ - from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint - assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) - assert endpoint.settings['response_type'] == (string_enum.StringEnum,) - - def test_array_model(self): - """Test case for array_model - - """ - from petstore_api.model import animal_farm - endpoint = self.api.array_model_endpoint - assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) - assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) - - def test_number_with_validations(self): - """Test case for number_with_validations - - """ - from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint - assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) - assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_enums_length_one(self): - """Test case for test_endpoint_enums_length_one - - """ - # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one_endpoint - import six - if six.PY3: - from unittest.mock import patch - else: - from mock import patch - with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - self.api.test_endpoint_enums_length_one() - call_with_http_info.assert_called_with( - _check_input_type=True, - _check_return_type=True, - _content_type=None, - _host_index=None, - _preload_content=True, - _request_timeout=None, - _return_http_data_only=True, - _spec_property_naming=False, - _request_auths=None, - async_req=False, - header_number=1.234, - path_integer=34, - path_string='hello', - query_integer=3, - query_string='brillig' - ) - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters_endpoint - assert endpoint.validations[('number',)] == { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - } - # make sure that an exception is thrown on an invalid value - keyword_args = dict( - number=544, # invalid - double=100, - pattern_without_delimiter="abc", - byte='sample string' - ) - with self.assertRaises(petstore_api.ApiValueError): - self.api.test_endpoint_parameters(**keyword_args) - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters_endpoint - assert endpoint.allowed_values[('enum_query_string',)] == { - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - } - # make sure that an exception is thrown on an invalid value - keyword_args = dict(enum_query_string="bad value") - with self.assertRaises(petstore_api.ApiValueError): - self.api.test_enum_parameters(**keyword_args) - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py deleted file mode 100644 index cf77b62fab70..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index 1ade31405a62..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py deleted file mode 100644 index 8d60f64e01cc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.file import File - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py deleted file mode 100644 index 9a4f6d38dfef..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] -from petstore_api.model.file_schema_test_class import FileSchemaTestClass - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py deleted file mode 100644 index ca37b005fd96..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.format_test import FormatTest - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - import datetime - self.required_named_args = dict( - number=40.1, - byte='what', - date=datetime.date(2019, 3, 23), - password='rainbowtable' - ) - - def test_integer(self): - var_name = 'integer' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_int32(self): - var_name = 'int32' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_number(self): - var_name = 'number' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_float(self): - var_name = 'float' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_double(self): - var_name = 'double' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = validations[key] + adder - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - validations[key]) - - def test_password(self): - var_name = 'password' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - key_adder_pairs = [('max_length', 1), ('min_length', -1)] - for key, adder in key_adder_pairs: - # value outside the bounds throws an error - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = 'a'*(validations[key] + adder) - FormatTest(**keyword_args) - - # value inside the bounds works - keyword_args[var_name] = 'a'*validations[key] - assert (getattr(FormatTest(**keyword_args), var_name) == - 'a'*validations[key]) - - def test_string(self): - var_name = 'string' - validations = FormatTest.validations[(var_name,)] - keyword_args = {} - keyword_args.update(self.required_named_args) - values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', ''] - for value_invalid in values_invalid: - # invalid values throw exceptions - with self.assertRaises(petstore_api.ApiValueError): - keyword_args[var_name] = value_invalid - FormatTest(**keyword_args) - - # valid value works - value_valid = 'abcdz' - keyword_args[var_name] = value_valid - assert getattr(FormatTest(**keyword_args), var_name) == value_valid - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py deleted file mode 100644 index 2972d01161cd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.grandparent import Grandparent - - -class TestGrandparent(unittest.TestCase): - """Grandparent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGrandparent(self): - """Test Grandparent""" - # FIXME: construct object with mandatory attributes with example values - # model = Grandparent() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py deleted file mode 100644 index cabe4d81f98e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] -from petstore_api.model.grandparent_animal import GrandparentAnimal - - -class TestGrandparentAnimal(unittest.TestCase): - """GrandparentAnimal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGrandparentAnimal(self): - """Test GrandparentAnimal""" - # FIXME: construct object with mandatory attributes with example values - # model = GrandparentAnimal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py deleted file mode 100644 index 9ebd7683b398..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.has_only_read_only import HasOnlyReadOnly - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py deleted file mode 100644 index 52156adfed2e..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.list import List - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py deleted file mode 100644 index 3feda0f688df..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] -from petstore_api.model.map_test import MapTest - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_maptest_init(self): - # - # Test MapTest construction with valid values - # - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test = MapTest(map_of_enum_string=up_or_low_dict) - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings) - - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - - # - # Make sure that the init fails for invalid enum values - # - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - with self.assertRaises(petstore_api.ApiValueError): - MapTest(map_of_enum_string=black_or_white_dict) - - def test_maptest_setter(self): - # - # Check with some valid values - # - map_enum_test = MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test.map_of_enum_string = up_or_low_dict - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - # - # Check if the setter fails for invalid enum values - # - map_enum_test = MapTest() - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - with self.assertRaises(petstore_api.ApiValueError): - map_enum_test.map_of_enum_string = black_or_white_dict - - def test_todict(self): - # - # Check dictionary serialization - # - map_enum_test = MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - indirect_map = string_boolean_map.StringBooleanMap(**{ - 'option1': True - }) - direct_map = { - 'option2': False - } - map_enum_test.map_of_enum_string = up_or_low_dict - map_enum_test.map_map_of_string = map_of_map_of_strings - map_enum_test.indirect_map = indirect_map - map_enum_test.direct_map = direct_map - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - self.assertEqual(map_enum_test.indirect_map, indirect_map) - self.assertEqual(map_enum_test.direct_map, direct_map) - - expected_dict = { - 'map_of_enum_string': up_or_low_dict, - 'map_map_of_string': map_of_map_of_strings, - 'indirect_map': indirect_map.to_dict(), - 'direct_map': direct_map - } - - self.assertEqual(map_enum_test.to_dict(), expected_dict) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 4dcb5ad4268c..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py deleted file mode 100644 index 4012eaae3362..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.model200_response import Model200Response - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py deleted file mode 100644 index 5858658d2947..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.model_200_response import Model_200Response - - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel_200Response(self): - """Test Model_200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model_200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py deleted file mode 100644 index 54c98b33cd66..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.model_return import ModelReturn - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py deleted file mode 100644 index 6a9be99d1a57..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.name import Name - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py deleted file mode 100644 index 07aab1d78af7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.number_only import NumberOnly - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py deleted file mode 100644 index 3f0b78835d4b..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations - - -class TestNumberWithValidations(unittest.TestCase): - """NumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberWithValidations(self): - """Test NumberWithValidations""" - valid_values = [10.0, 15.0, 20.0] - for valid_value in valid_values: - model = NumberWithValidations(valid_value) - assert model.value == valid_value - - invalid_values = [9.0, 21.0] - for invalid_value in invalid_values: - with self.assertRaises(petstore_api.ApiValueError): - NumberWithValidations(invalid_value) - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py deleted file mode 100644 index 35bd3b6d8ec7..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectModelWithRefProps(self): - """Test ObjectModelWithRefProps""" - from petstore_api.model.number_with_validations import NumberWithValidations - self.assertEqual( - ObjectModelWithRefProps.openapi_types, - { - 'my_number': (NumberWithValidations,), - 'my_string': (str,), - 'my_boolean': (bool,), - } - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py deleted file mode 100644 index ee6988e28ccd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.order import Order - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - order = Order() - order.status = "placed" - self.assertEqual("placed", order.status) - with self.assertRaises(petstore_api.ApiValueError): - order.status = "invalid" - - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py deleted file mode 100644 index 20282dfb41ea..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import grandparent -except ImportError: - grandparent = sys.modules[ - 'petstore_api.model.grandparent'] -try: - from petstore_api.model import parent_all_of -except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.model.parent_all_of'] -from petstore_api.model.parent import Parent - - -class TestParent(unittest.TestCase): - """Parent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParent(self): - """Test Parent""" - # FIXME: construct object with mandatory attributes with example values - # model = Parent() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py deleted file mode 100644 index ca87189bba50..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.parent_all_of import ParentAllOf - - -class TestParentAllOf(unittest.TestCase): - """ParentAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentAllOf(self): - """Test ParentAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ParentAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py deleted file mode 100644 index 17a4d60e75dc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] -from petstore_api.model.parent_pet import ParentPet - - -class TestParentPet(unittest.TestCase): - """ParentPet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentPet(self): - """Test ParentPet""" - # FIXME: construct object with mandatory attributes with example values - # model = ParentPet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py deleted file mode 100644 index b072cff5e9ad..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.models import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] -from petstore_api.model.pet import Pet - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_to_str(self): - pet = Pet(name="test name", photo_urls=["string"]) - pet.id = 1 - pet.status = "available" - cate = category.Category() - cate.id = 1 - cate.name = "dog" - pet.category = cate - tag1 = tag.Tag() - tag1.id = 1 - pet.tags = [tag1] - - data = ("{'category': {'id': 1, 'name': 'dog'},\n" - " 'id': 1,\n" - " 'name': 'test name',\n" - " 'photo_urls': ['string'],\n" - " 'status': 'available',\n" - " 'tags': [{'id': 1}]}") - self.assertEqual(data, pet.to_str()) - - def test_equal(self): - pet1 = Pet(name="test name", photo_urls=["string"]) - pet1.id = 1 - pet1.status = "available" - cate1 = category.Category() - cate1.id = 1 - cate1.name = "dog" - tag1 = tag.Tag() - tag1.id = 1 - pet1.tags = [tag1] - - pet2 = Pet(name="test name", photo_urls=["string"]) - pet2.id = 1 - pet2.status = "available" - cate2 = category.Category() - cate2.id = 1 - cate2.name = "dog" - tag2 = tag.Tag() - tag2.id = 1 - pet2.tags = [tag2] - - self.assertTrue(pet1 == pet2) - - # reset pet1 tags to empty array so that object comparison returns false - pet1.tags = [] - self.assertFalse(pet1 == pet2) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py deleted file mode 100644 index 091b30cf8ac0..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - def test_upload_file_with_required_file(self): - """Test case for upload_file_with_required_file - - uploads an image (required) # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py deleted file mode 100644 index ee7b95a677f1..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.player import Player - - -class TestPlayer(unittest.TestCase): - """Player unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPlayer(self): - """Test Player""" - # we can make a player without an enemy_player property - jane = Player(name="Jane") - # we can make a player with an enemy_player - sally = Player(name="Sally", enemy_player=jane) - # we can make a player with an inline enemy_player - jim = Player( - name="Jim", - enemy_player=Player(name="Sam") - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py deleted file mode 100644 index 44c6f5430a57..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon_all_of import PolygonAllOf -from petstore_api.model.shape import Shape -globals()['PolygonAllOf'] = PolygonAllOf -globals()['Shape'] = Shape -from petstore_api.model.polygon import Polygon - - -class TestPolygon(unittest.TestCase): - """Polygon unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPolygon(self): - """Test Polygon""" - # FIXME: construct object with mandatory attributes with example values - # model = Polygon() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py deleted file mode 100644 index fb04385d7134..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon_all_of import PolygonAllOf - - -class TestPolygonAllOf(unittest.TestCase): - """PolygonAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPolygonAllOf(self): - """Test PolygonAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = PolygonAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py deleted file mode 100644 index c2dcde240e77..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.read_only_first import ReadOnlyFirst - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py deleted file mode 100644 index 7e1c0659eaa2..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape import Shape - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testShape(self): - """Test Shape""" - # FIXME: construct object with mandatory attributes with example values - # model = Shape() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py deleted file mode 100644 index 6124525f5170..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.special_model_name import SpecialModelName - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py deleted file mode 100644 index 056c248d6a90..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon import Polygon -from petstore_api.model.square_all_of import SquareAllOf -globals()['Polygon'] = Polygon -globals()['SquareAllOf'] = SquareAllOf -from petstore_api.model.square import Square - - -class TestSquare(unittest.TestCase): - """Square unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSquare(self): - """Test Square""" - # FIXME: construct object with mandatory attributes with example values - # model = Square() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py deleted file mode 100644 index 466d3acbc144..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.square_all_of import SquareAllOf - - -class TestSquareAllOf(unittest.TestCase): - """SquareAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSquareAllOf(self): - """Test SquareAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = SquareAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py deleted file mode 100644 index 0d9cc3dd36ea..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py deleted file mode 100644 index e2e9d8b420b8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.string_boolean_map import StringBooleanMap - - -class TestStringBooleanMap(unittest.TestCase): - """StringBooleanMap unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringBooleanMap(self): - """Test StringBooleanMap""" - # FIXME: construct object with mandatory attributes with example values - # model = StringBooleanMap() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py deleted file mode 100644 index 5eed0ad6f0e9..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum - - -class TestStringEnum(unittest.TestCase): - """StringEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringEnum(self): - """Test StringEnum""" - - """Test OuterEnum""" - # make sure that we can access its allowed_values - assert StringEnum.allowed_values[('value',)] == { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered" - } - # make sure that an exception is thrown on an invalid value - with self.assertRaises(petstore_api.ApiValueError): - StringEnum('bad_value') - # make sure valid value works - valid_value = StringEnum.allowed_values[('value',)]['PLACED'] - assert valid_value == StringEnum(valid_value).value - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py deleted file mode 100644 index 68a3b9046bf4..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py deleted file mode 100644 index 433e572edddc..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.polygon import Polygon -from petstore_api.model.triangle_all_of import TriangleAllOf -globals()['Polygon'] = Polygon -globals()['TriangleAllOf'] = TriangleAllOf -from petstore_api.model.triangle import Triangle - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangle(self): - """Test Triangle""" - # FIXME: construct object with mandatory attributes with example values - # model = Triangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py deleted file mode 100644 index 322d2e802eb8..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.triangle_all_of import TriangleAllOf - - -class TestTriangleAllOf(unittest.TestCase): - """TriangleAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangleAllOf(self): - """Test TriangleAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = TriangleAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py deleted file mode 100644 index f9c050b81a82..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.type_holder_default import TypeHolderDefault - - -class TestTypeHolderDefault(unittest.TestCase): - """TypeHolderDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderDefault(self): - """Test TypeHolderDefault""" - # required_vars are set to None now until swagger-parser/swagger-core fixes - # https://github.com/swagger-api/swagger-parser/issues/971 - array_item = [1, 2, 3] - model = TypeHolderDefault(array_item=array_item) - self.assertEqual(model.string_item, 'what') - self.assertEqual(model.bool_item, True) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py deleted file mode 100644 index e1ee7c368628..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.type_holder_example import TypeHolderExample - - -class TestTypeHolderExample(unittest.TestCase): - """TypeHolderExample unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderExample(self): - """Test TypeHolderExample""" - # FIXME: construct object with mandatory attributes with example values - # model = TypeHolderExample() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py deleted file mode 100644 index 7241bb589c52..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.user import User - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py deleted file mode 100644 index df306da07761..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py deleted file mode 100644 index 4354664815ff..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.xml_item import XmlItem - - -class TestXmlItem(unittest.TestCase): - """XmlItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testXmlItem(self): - """Test XmlItem""" - # FIXME: construct object with mandatory attributes with example values - # model = XmlItem() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh deleted file mode 100644 index f617f3adfa64..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png deleted file mode 100644 index a9b12cf5927ac757b054dd875ee137c2581f69bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z005plNklH1~87DdzFiA2XC;)~Dpo$3~298uzpt7UB?2C zrfPXaKqE40ylK3PysV@&`KFt0-oA3>N*fHwwj}%@A;B=D*V-^3rG!ZW76I^B9@-KC zfcx*if9)N2+};ZUfyS`GYGUP72QH^lJR<@ck#YP(vYDU1^7d=5z4ouR`v4F@Nabc& zLb)YG`lepJdcUe)d-l2K zyx+EMn+;9f>WF|wWYl=$JooJLs~>;-@g90(3kED$Fc@GP91I35VIa{AEG{nY zvw8F8{&{(Mcg&voQcL&x*|~mgF?k;cfR2d?c;u0XX7umh|K6qw9ud%pj2d_(Fkkrl z^Q#~K)3hGaAP9>gNm&_?3=;$k765@>@hSL4`-^bt>E}Z6H3S6PF%3arOT{xPiShm6 zaxDJ-3;f^iRX9|27?PB=Az0cLiU1Kio9=(PpI&~}St%btePp1vO#Y+2CJ+e36c-ow z&igcf^8ESphpk+>(vvzC9(RfzfDl4>fP?Mdh4VZjMxQ=?@Y-vywQ1HodVd5oBIA^^ zFc$o0{(`%wOdh5;vMIIOAz^?JV2PCI({a~1SD@c%=Q-O+LO>I}064#sRB;W90D~nC z1diaTZ~u!W`@d9i4~rm70kQ(H1R$V-r(^)1e){R~xW99MoJK8et3pD86hIgP!cuE2 zKw1>0Krj!2pkXD zN`p!8YmOYQIAhVG#V^j7F=NEeojV=tKz%-WTnrHe3^M%2asWp7z(xoa!_mMqWY}Q5 z@WOLZP03Y>fJS6gd+L6-_xm2_pMU;s6QUk=Pew6SD!BD)K3<5G%vs zW(dGyhG_$b*Vor%uQKZ(#&3EJo6C2BC`tuPL10!XU6PE15$%lxEZWaYWH42V~ z%W51sawPu46(2nC!V5DeuUfUr0|vqe6yahO!71WUOT=$!_^lEzkVw4#`s-7&`ex2( zDrwpXXhcR>5|ULVTV`ct9Vp(p8wN`N0u~s8C0H;7n|R>dff#&d5BszgAjyyhfye?| zYQuzl7P)~zA_7|h`vew{U=RzGR~^8_jq|YOz#g^Pm=O>vK0-vWq{Oh{Lr&;~mQtD< z3pb7U```aQck$xIA)8(O?s859!zQC~h}EG3!l5onD0uj-5)tzFj^gdjP1CGs3hPBg zwoGIYQNZul!~D%}esf^w&Yd8@zhMM{Nnl``R9w@x2ZZ*~*#ZkvR)Hm8k{Jw4%Ds_* z$;x%nd=55+a{@C-w2E$p7t_Yzyp|mh04W{_)JaW}5k&$^-dv1j%iet=9QcJBrKP3G zul;AAe59n;S34~t9~ zEFtZ)M?n3~5bAM~AwIo!RWy%-1cL(r1VNGnlYn7akOrf)GJxAQ&c()qdl3bxh+xv? zaY%!)Y15{}xVTn3!@D6c3)dBnm^yXpTpiH#S_q-mffd$D2+fFub3>?FYa?6$H8k5| zVdw7RsG0_FBcKr(jRr8Ps;XKhCwDra;|SXI(3ZxzE!tvE>Wye+Hiv+O1rubSqJm)u zHPtID5FKFRN=ia@b~e(|(~y#! zgcdDZf{1YF;32GDy&A8)@(<+Z=K6xDLb%4hBDVp{-p#q8d-v|IHFlM2|6Oo1IyP(V1Ssp;!)20KQ?e5i*8j_nrMUbJow|Mb<(Fq%ef3rM zT5Or~=FR)pZ>Rijgg5(9jZ0RIWf080a9^L4l!UCl*|_40ez>StFLdb8p~m0ir8%$Q zfj>@lVkTY?)1R4<(Hn~vzd;fAq?Uk#nayq6wq3mR?VM-+^rt`d(B|T?qTEA=4n?=L z)U~~O^_r8GmiA_ReC&>s1*}um%GkDT$Hm#1SsxoP5CB6EIjm121AjelIQpJ`E+7mD zutOKG+iO#F^S^BSFXrzoK!AkJ>|)2lVP;I6I1#gE&GN(&T+j=(7*K6MGI;%DW@h4+ zTW-e1mt2gvxY(2WE+a>b#;2ctis0;tdmR#+wros{i;LSC0gdAX4c|s)m|MTy*6;f3 zuYb3=xHtqLye40GlQMK63>h*6Lx&EX(Y0&Ww-b{S@(jZWoNDFEHJ^Bx_Q8kD-kDWJ zMQXhoAV&{_h;i}hoiU@!wTgd1isBhulvWqRkN^vbl0X&4teb;f6+bH1#dc4ES)=Nn zxhJ`l0hO7N(#_Z~g#`-zGc7F*lP6EY)%~xA5ViLmD=VweDdns%*I+}K0G@pEi8pV! zam?^Y%Jl@nLrQ7Re{I3sDO0A52uGChnvT_59De$4xZqS`Vj_O^t6#0XX2{@QCnY7U zG7O^vKb65S8C;c@SAY@Mj)Y0-gbuI-3;>c4XT;#0UgOcqXaxg=Dg+>4_}HFxJ_KQP z$u>;b@NeiWiw3UHf;aNT4lK*EfdeoM!}(jE^hAWDq$CU)GzjG3o9p zm^W{p&l>W&DoII6$X}Tk6^UsaCt&E**~1S$R6cw5oEUdv4IigJ=(W}OtRmqCJCGW%pz6&LRUNwtwIgJ4){{-&Nc2*b}z zM*!rcO9O@kaouO^m3yRsKrk@*s|EPryUk!hFkslOQ>gV2?1F@&cmqIob|$7x`xCl! z?OZR@U0GR)PAO*xU9@#n@B(vg8SW4%UnK3K<2K0_Q%PAOROTvIr z=K)aX8ttMsB7(&X3Bp6)yp5%M*MkN7;uqfHF@MZU-RIV=TVu+UDY*HTn;dthA;y+1 zU*WP#`*|ql{+P^=Aw%%O%;y_z7NyapT$$M%KK#0>mHDfJHoOcIyC5gJUcH8aKy}|S zT$N(@*h#3_n~{-$M<0FkhOVhy-aJ|$wJ`%mWo2c{yYHM-viPkfh^it~MiC54Sz{Im zL))d{(Q}5O3IUjGC}yZ&+sZKNOs=Axs0DCkz+^(1aj)pPvAZ~a)8lHsA7pI zC>Mi+NMKrjLogtSA&Fr~VFLo8W3xC6I`e$I_5C{KMhSwDminon0|ZsJf9tPr!yoRu zuU;}e$20o(?~i%&<~cs1TgRf-;J$tPQroo)FRmQ1G~j0=rX+Pb;GXnWSnEJ9?vW!$ z;?~TPKKR}5?wOLAo%Od9(Q=SdngNFEl8!k%lY-#Iv!Rzzy%FfRI zTLd(Yv2h-L@R0*EXU=RH4m8v$ul^n|U;tit@wpRP5S5jc`2346F?a53$on)GMMXtn z!5|#ZBm71TP3a~kCSua0NpFrCHR>0_q$5NWkW!jL2pPdY=Q(z4S26oO!(gmt6^ z3BZ5?UP%Bf2{sk5=!}U1#eg%{x^D^~F|Kef)|72iKxw}}vy$~%yQvVZ1U?b+UHhQ zR^q*P-^UwoEJ99BPDort|6LsyAUI|c3?NU({Rzv3&XR zX|rd~j`3O!p#bDh$5pTCV1xy3H|OWp#QTo40(0 z7oUF-IXO8fD=Tw0qBmx8H2no{;I{h0C?l-35Z;~e6WBsCMFK|?wylYKB3L+?2quZ& zcKSJf(XNj}A3r%u(jyj31h7DrZE5JaGoa|`OwzFylq;gZK}b_oz}oL&*_s>z2Kudf z8l`~>pExlDAuB5juP>b6s6k`eV~^vxXP@(}3&;9n#@6lIS~qJJRT=?}Fr%WPGXCsN zXO#r&E^3!VFS<>eH=Z>A|9D1Tem-W;d9SD^q0BN7_04_Q0T*R5pR2fw*00xr;Sh*rE?D!uR?EVa8 z)*%FlVY1=0JqQSi1A#;Mc>h=U=*O=yWBY$`ea8!MTgOY$(uh$ed_cLbV2RSe0en)j z6(8^W1||~%WI-CLX%n*mguwI9zvuyVMtpocva+%;e&Tp!^y$;!>DRM5b*g49DB#$< zdGj@m5i}ay(vVV`NeRhS-XKu0sTLa>i;bHK8%5e|_ny7@;~)NrWy_ZNz%5j(L4*WS zL*10>>CeX^r-jR&c*SCBYISH9sQ&$-^M+zj+f)#Hee9FW6dc@zsoyNc*N65w!A?(~ zM%6ckExVngzjQoSMB}Nh*CC@-3Ic}2t|R4`wfz%(T(TJ@fl845dTpJm=1r`$JQzXU z>izROYSbwF`7e*7S;J*m_9t{qIm1gP^isUT>73s3*kaOM4>0=!4h z=4kgwAR{Bg7gQvMPYfm)q?xPmPS4+v4R;7W?j(Cg63}RTUh!$H8?Zw1( zb5Uj;h5-|j7$ohWD+E{qAl0Ew3PV{6f&eQ37^+9CfQet9bt$$V*pD~9UkhP#OQbL$ zZ7R72IX}osUs_xTO9O`L0;d6U^ytx;KI5r6u{@-d*t>6^Q`o1oJTWbr?>|ye@kY-J zdX4v5hgzA;0wXCY2?eWi=_d&q!NB4D{kDm>^O7Y?>-EX!50Cwi$*nv=`wk7OChYZbh;9P z1p;I_>fc9QK=uYEX0V6`qYA`8nRNtXzIYjXj+B5{C@^3NDHzO3do*B3m{PTIguPMJ zdszSrFqx`tqivb!ir3(5QWOc5m9dX=gO!CAAj^rH=rVq3GhBtGl+&GlB(~LY>m9e_ zfj|D?m{#WUci+RJMQ9~`M$?V>Pi+c5TL5&Dx1wcf2vfBt;cKUf>CPnZj zvqpLudNUg!SRw$TC`|wQUHoU?Drb{ww@uZO7zh9u+O`|o$DEGDW^veAQHGsI%J9+t zEjVNyR)-3!7LFDPz&@ds-iHN2ges8J;viVo&o86kj|sWu_Uu>z(grRAgv`u7nE%Fn zA7EBiR^rL0ren#QOHfo)6iU7$Wx*)RMpfi0H_dS7NPrL^d!C%Wx2`ToxIQqFB!&zb zf~WubOzUtm4X0%GB=}2ufB*QyPwop2;CWBx)YQ}_1sM9;$B(-OWXxEqy1)o@d+YVTK`8cB6O8B(*45H8!eQ<-2k> zB!DPpSdy^&NGblaZ?&y94oGR)B`XACfeT}k@Zfm^(6L!-0K$oZ2uPH4x(rWmU4bQg z*8!%0B?++O5rPZ^m|++utbhe!5L$_5xb%#3aph^}qD#y6Xd4r+tP3d}>txfx-PnA1 zFV>W9$A5qP1_!MQ8)(Q0oT{h~BLIQ?+yYFR@>@JT{YhDnzfwH))O6(K^GZiTI6c9onE~+K&Nx1|=&+Ji+bg<3u(5EA->njZ$!qR<(n6)b(rBw$YSU?b? z5)x4mkR+5u094hir0N;FN^?X4LN&# zJ9gM{09)8bS|CFpwM9D++nEcNFvC#Yt2=inAR)+Y)V$@;UNp1QtChrvvfpQ7LKb4p zSk?3h5{C3!GJB5vh=;#^4~zgz))@r_0FoqHi{|*_c>{698C{g#CkPA+mI1qb-ph^w zBnT!HxlB>gl~}SA2I8Yy;GRyGq2C$Fn6mLLlv#&7@ew=bAq>D)izAzXs@5_fgq^M? z!<`C?%Pn1P);cVg0{N#8&JV#76!t~byK{(|e*ufNXCD8Lrf(I{>qHN9J8 zhu3xxbk}Z=UWS0Q{cRB-ToB(0x(-FxdDJA8tN0bFbs|Gz^^e6$K9K@SB8LIX=5X|B zmF%PyEwH1@!K5sLsb9a1vOp;Wn=0iB3&PHR#G5VfV%iPp+@d`s08=n5Ettfx30|S< zpfX7OLjePvu5cH{or78FH{!PS|G^LPAcP>rJMmOiyG^5%Yorgi#OT(zF#at3tj*cz z(d`J<8RBho9k&4l%9KA*QwcSBfG9CaCM&b)*b$eOHLrcCSK-JOopcotgzK zm0rT)#c$#FzyJNk$!8^hLa6_~J`G}NFtfRN^X4I5p1of|TA+Xb{*hf?%cHEU+@4>h z$W3;e!+;Q*nU527_i?((k4yaO&$w_lp;>sTZ0R-5BX#rA52qxTp_uVTRsfheTBnk<>;I79+~mz%bZmrIPD*SVFlS0Vy%3C{Ky< zDAa;9Y*|4DZcoU@g|TNTp=kT`H`%DA4WRbjd96BP(%JpgBc2qffQ0~Aut?yk&cm?y zqT4a~tSfPDtM)bl&O|^8r9%SOa$=G-`+U!R(4x)Egf7k7;pr~J5N9?AJZWK_y3Q|H zh0@Z}WbeK@GQ8QvBJ;Z&yd&1&DiePox{@{rPU=Gl2n7--)t7EvVZU?OVln&?ws z_ev2$C`}8tocFLu*y>smTMv8(iy4MZt`Z;!0AC&c4*BIfRCd8oj9_6Yle}}Q_86O- zrQ#))1vZ3gG;I^MYGVsn%wRGwNOzx;PF1oBnCjFpv(iJY!TwMTR@PP@1JV`C9(G0=;-X^QEDhYO*5Wr7 zPyR``Cjej=M)&GYvJ=sSh>V(zwQJXg5a8{i{XoNGHDh^ll31xcTLjL(CGL5{{0sOTNGXwB{J$Q&g8fxY;zcN@stGD7>EecF6kyP0oRIC+rsfypCqyYnjO^0@2Lg4}wA1Q;yjMYCDIq?8V02_*_N`i64Y3Hf72c$Nwu+4a_ z049xE5DAh2dy^{g6AWB-+PR2}ic#rj2@r(+{TQ1M?SZgm1^@|*$suP2q?^hOw%n=( zEs}~!YlBCnDQ)m2N3FfN8Dn?pRv=`s(m}Od{rKYv4b;Xk>v@p|Y(#G3i(iwfgNt}p ztHdU{#ka1<<14KGlDoSGG7 zS?I4O06-ABv}kA7_^bCM7`A07K}6Q^Souv3G&K4drV+<>!BDtpeI%w)HzPSY8M(Q+ zHYHgH;grG^NZA%{Nw+OVQG?nO!NS(FumhNaFs5BktoUIwzCQH5;&NCLWT=x{2SWe% z{Wl)vE%lfo0Tu$Co1fv4RIFQT3jl;=yJVIU0lMI{WUMaVsld=uaTI0?#g#u|){g%v znM5cO*m=#{;>N^Y7;;8;FruNFGgyjFev-z#rmI^*2|*eRB>^A^hSf0ZNYp1-c+jua z(Ha0<*z3Z`4zGjJty@=h(}nQ4CnbDD#TYEL7^N1>sbQcoKyHNtCp+I*^E?777pp5^TbwyCJ|r zxk?5M2x;NlLwoSZ=A{_3_El^-xZ84?LQ_#2Pk}Bi z+hbPx4QL@uuyF5j6#*azh5%c3z*6%! zoblj#3%2Rr+$rak6e za0@y&Z|l5Y6a(OZ!@Pv0$Xd!haLIo4(b-*-u!1v6jzpi0U{dHtO?J6HNq{6wsLgA@ zKmdf&z#&ZBFdv%_?gr@OgDym@=;L5Sk&3Taw%4eLaAegd8?-?{gNOpsk^x6Zl_-SZ zrJ0M7QM;pk`}U#2#ZoaGzdf)|=|Ttrk`@GN$hfoxdUgNRfNh;b!`*=Go1KP#pFb84 zpECsQo5!OH0RYO(Hv+2rnldcd(aSXL3`w1@N9i731_`^W7T6jnRW&6x<5Nh>(HfOd zO`l-PA_7vyZCI(2l~*0aL*Fc|oj5J&Iu`ZQgeL|h3DMEf2kN`pwL!>T3_cvJqv34` zw0!xyksV$~LBFJ=BwqkfX>tmD@WWnR=oqlAhv94nl1ihrKC)=Gh>nW61ng{)!2XI7NV{1z zNrq+E!-@zv6`;l ztXZ>zr+gq309v$YQ4-EK)+sMm7Nu1ciZ4KnDo90XK9o!~vmw;$#AixF)CM<$e!}C(n zC$+hM9Kj?hQ~=vH(D?ZHZ@oU7TXSN9nNVC@97(&@(YW>YTcHJxwaS$= z)M+|z?8oXN=bf;o^c%bA z&nDm5KtEx^Efq)GXQxykl!(6Zo^(3sr8FMYqT91)Ph^MJ!RXTYJjBPxyRi+DYGVt= ze|E3NkAXvq)MXb)DIeY|qo+(}#msb1YRzaA?AZ)<^%d&=8L!toyBS1ujdeVY>km}!;Eq^bv!|P~_88gP=MUdUP&|-;l zs{#*y^RCj?ly;YQNY%y6(D%!7^f*<4l}jJDgd5lWx>?OY?w~AM~fuS-MtzXEEpgJK(K^#dc*XNO?IBg zLc)+htZ0s2t&&tr0&;_^78vUf@3uKCyyN??@s>wG{c31!wn?5-$-H*ug_Fm&qF z>623)G(4u$hK!7iYJ+tEF!$g8iR|t=8u$MGcfN%yp~P}XTKMFLukg-yg-Rd?0+vnf z*PID5ge#B>Hz)@H7ORZ~OFA1tse&tT@q&<|OsjwI5tj%9q$t$V_Sa$IgOaaME)OX% zl6EUa-K*9xo$B0^wlqiuG)XcJScmZ84_`T13xln2&skei3^r^%4Uhf|133HKbKXB?LBkuI zv41ZdHELv4aG=Kv9EF92kTMe2sEZLD9fezOz16Yw45@eIf5iww{E@tlm(5DW=TXv zS=m_|l__g@OfPoa6=p`x(wxW+ucPtDseeFR>v%AP6CW^jX_&C^(B>Tc->%h)k6)j$NRrhKurGcoSc}1 zW>L`xPf5_IE(Mg7l=y}hAp8U`wO}53r1OjQa-sM z1(+C5Z~ZUEZFmi<4r~K)mCB$9R^?da61sGSsJ1X5RnwqK!78gF2~~!~rbD|hyXX^) zUjGl=_~k43&+a^w1rFNl#I0ntOnXh(r|N@WFU6KayCJ0I$OjrMYb_;fFmS*+gehAV z+106v=&Iv2BrQx#xfl|*FpsU`t~c<1cCSJ4ky1sB3rJYPRY&g~mtwmb9MHGJKLTKhDy%O578BRa#rTa2 z@YZ+hvFmUtm;_8q!09gUQ5I)bje)8l@zsIv@y>Va@aR|XVEC#RasAp?@j~&(*m7VG zED#K7!pX{z0l~uQccOGc0}w1wW*x$W4X-Snh!Btx1_5hIcH*gRE0nSrTaZzJuv7+x7`XKGb9^1s*e>f= zfFpdsr-R3enJV$|_uqnT?u&X)m)<{U@HM~Y2B=b3*V%x4h+A*Hm6yEvPSB%nO9N&? zQc?n@PW>Z(``h24w6xUs%-e3e4O1VuKeGEza@>8_WGq;)z|&rleLlAiIRUN|D2fs&&JdAG+d{=G3Tewz)%Cx7Dbzs0ifGijiXl1s* ztaRP`L`eWj4P4Svly7!Bx9fO=fJBu5qAfU5e6X#huMh3ULtEalc_D1OW3VeqZJ}Ql z00_O~k};q|8WN)7Q7RAPlkdL8;_ugjpF=t5*+TKIq9`H6soBf*XpL$M^7EHmJAA}oM{L$UVcZm~ON8;N zmTTdj#Kc4ttjvq-`dS#1?w*2q^X54l%Axo}k%@GNbxE#}kA990_7N-B!jMYy!L&=w zz4tRX;LWa>jIZUPPE+a*>tM?cvKp9@aw%?1=mVBf@DZh0cdl0(%LKWg0yiE&cI;s8 z&NZ01^AnU=6*f;qHGZ@N04o3~44X)$;w|p=s`ilTx)=r+0b;wKn?w{dm<1O1o`8g? z(~q$~EG1`10?|^U%2ZjRHKp4yzHlzI9FKRd{_uxCto`+!cbwl)Yo)>56971`bLWQ@ zAOynud$uN`w>Cw`JD3^C$;px3UQ6TYXQpHJ>{-xq`dVGvwAqaem1;FWcE3~gJk=yw zJzw`KVOB8>uiF{ydU`j3e%|QOqp@Pee=%s#Ap4MDSg5j1c-8aNf`u7dS76lVuVQuC zw+>@e0gvjJBBVO;Ez&(*0n1_#RCoI?%8D>?{l76|$Ga%w!wzU!Hd~e10-M4COQqi_ zz-)jh%I-p^tQ!M1<(`$$ux|1^>8yUo1PmQq_O?`_fC9A_Jrr~=paQ@(Lk9o4LE~W! z;ht#ggPF~Q4vAGlxQb5xQ^y4ejkubb$82HNteLoG@SwQF`tnBPl5fQ>XqBgRU9qi*NP6dLY)VQ)yq#NY$>B zCU;o^NQgcIV>{gJ{p}T9v zbSM2R6h&TGD#h$|wbXhIIIS0>U?RW)J4h+e|IBnedhS36T#n_Q=<{3Hm8@&Zw`1J; z|MQ*g`ZJS~l90bLFG}y9hUn*7FQ5_b%jw6S|N9H;{`99mrF-2D*Yx$|{e6|N0i>j) zATR&Zh@NO2jr_a<+;!L8o;n~;I|Ar>38gXW^eh!>GwbxN-Obh0(Mt{L z@A^%({cV^TS6?*%8`f=r6sj~`7iqIcCjW2}aqJH+{c9=o| zfp()n288WyX|6;SDglZ@TJ!ek5EF-we)tN2RIUfRaW+6vx&^t}4gqBqkLi$sdpcd| znhnROA5-9^0-uHys4^rbuA7V1<=YU&Y7Sj@knz-0PrZ4=jn@x9mg|2?#WaHd-nw;r zzn^9IU7`NX&({d{pp?I>2rjEve}?uQ+C_GE9gp3+_uz@YJc;Ew%j`h3@b}%drSddO zk^))*Ov}*;#KyKn-@bh@?Al?t?9xjR8yj2GwS&o%euvjyd(AfEEmt(h7Vxp`^d!iz z;|pq|McFMP?MhG;oU|)dO}j;;zHXBZ#Zom0y<4W>$!^yo)@+6ke)tMcZhH^kR~%6F zF0kD$Nw5sJBG&>VG5R!2I_GlqYkjU#?UEMYp^qOera^YIX;TQS*uMpnHoxJxJp%q7 z$J>jxH8%_+&`=%Y>lHMr0}p046FVkVc~3L9B9QEp%JKons8OTv^fS{VJG$OomvU?< z+<^Q~^H5k=h#$*J9bSeqpH%>}`vvEtWs4RVG-x2sKC2U=qoYsibLYJD3jXrclQ>j* zP!)pNG-`&WHax)>AJH2*N_BFwCHgE!Do+#8ba9xnBm{0tz8K>YG7!bls3eIfsD85_ zezzGP{`eI>E8l@#6(!DL7Hc*`ued~9envM8XqyH@3K*oi+1m{fj``iBt;Noyqyq-8 znS_wH|Ni&q*E~M$v7TN_!;NM5M_gPS zHf}16xFtWaaip>mH{S3I^9}sp1&wy=U#r#q1p) zD`qS!>O4GPSX^A(T$ohR(D$O=Y2@MlzUG>NcLi6v`T;{YLD9u;y%_wI8K|tR#JkJi!{7e)EY`1I z?@LU5bx>8`7w@G(Lb^MpJETFnk#3NdM!G>jx}>BVq`Mm_K{};FIt8TRZN9(vW}g2! zbBA;9Is5Fr)~A+y=vUndDj^{fK-#>1B?WC92zuyE5g~g`aS7_gTK)jYQBG-L-8+VU zT{xY5m{H@lOGA8yIn&bQ#I#ygNeI?lXDI8>NV~j@5va-JsY)S%@43tIQdrYxPkQ9! zrtcFHUbl%+5kTVy{Ft*_qvYpjs5PbRBg2b}>hS(&ygy|gH`Tk^aevm2XOtryOB#4{ zvp@#K4^cqJZCURyk0ufPva{OTv$*tpvmdq!V!HxH2gjXTHX#M=OtcD2xmT)kZO72z zrfxZE>}1HHCT}Xkn0*R}=-D|fPVcZ;Pi}@xH5ge?h-i&3q}+~I3E;%nt?s{fN_9BR z_vsMcjdXPyZ*8aLRLiUO!@|$iym3wTeez}JQkr)0lmkG=|A5P75``qD%M2jS?_D)+4Ltn-%%yzK) zvuHxbm>twYD^=W^GX7wjP7fr6Qna>FHCZ0lHI~ID?_LYwH=Eq#CG3YUnHRORS$c_{IkVtj&3X;W!{-|KO9L8#3SF^o$1N$wkRq*um zL@XS1U@BO5O?~QTYQfB3mF4B%S!ha`B}q$Fv~ej5-dZMo=TujCCnrkyGst7NO}xF~ zS{}#0I$h-O1D`Apb0>T>1a3()e8oyubW@sT(C%>8bfm{14n4yC1J?9VQO6;?>?({4 zAR`(5Fmo`*S|?&Vu2;RMmm{S7r>T#5I_}2(B{V(EW`^;7esK?tJrSVjz(vBMl>Ek$ zEfxCHXY|Kdb5c&*EySifo>yJSWP#sJ{oQYxQ%vYM_@AX{05|us6|5iOF;xE^yc2|| zr$&{!Ff^*&;!N|R6J4K^`n+#l9g-RqRo>U%FW_^Iyr9odDc)4C-u}G$cjzD{svatvZ_6Cb}FJs!bMv(djb; zrn9T~abG!JgM`4<4r#0JwFu&dC*N<<>a&0DA70_4nkEg47RoIx1mqWIO? zvKk+|jo&}YBSHyw?V2uEKWQ8Z{>?w2p@Lh_#YSh}+%k<%T~O5_e;=xkg<%35LVPNI z)g+v}h{iMNg%~l*+&+5^`YP271*Nk*2NSKXHnt1R!nLJT`G!(rJq-E+54x{ehbk;F z+-xZzfw`7$gQ+nc6D^W@dPKAKX?Aekp_BnF9Y*-_ovc5~kF#@{|4KvT!pkEFLRIup ztZn=NJhU~^kWIzF@M@*CD7U?RS*?5jPgJ+ozSqw-IzqO8$M?bwySI4QrLyr^>DzNz z3eB#Rq(1Ah@w3DPsL;eQ^kbExuQPgO16eBg*K4Q8#7;HoEW0tFr(kOsS=NX#|Z*Hnzoo1vM_RM@&^Nk5WcjQNh7M&a; z`Gwk7!bbyGJKh(C<+JnedTXKfb7b=vf*9o{CpD7>U1VT=b>&|5J?*l2UaPV{*r<)y zfn&5wrd|AVIhFjN_Gq*ms;Y|?UvO|PF3w-2rC5CoKUSW&dF-AXtPXv>pBcWn zY0!BS!BD57x4&||M)WN!tF@Y9r)0I3jz6mh<)UVg^l+mCR;xgAAGx5YND4y5L1?Cb zb-}2~?6Y;%Hgl&&jMlKi+<#;Sqo5iSS8XzKFKe>Up&N|V46E_Bm25Qm_X7{2L?C;~ zGla>Xm#*BU`{sNrhlX-Sm?P&q5`^vQNrc6!z-yum^iZ>$wtZQ&;c?R*p)QnHGYe z`sVm(>SLn&KGhj@XQWta%IgyI`q?%h&|y%Bh>*Sb6^faxtQY~}JuZBI6lARN(IJ>m zSeVrJ?lOjHWyq=|9&O!SJgjWh!xu{U!3qu&3oDaP8b?QNE2EG~T%YC$SKdu1eCi0@ z4ZH8Fa8lIMV^uHSVORIMP37A;ibyD!N;kjPmBX0g>)-`>=%Xi?K8q10NB^3U>deK_c2^3e-R8zz zKNoc}QG#T$W`AGms-U2-Pj6$r%yaH$SZgMW4`pI*{bOL@!}Jbnd=deHq6Hi0zoW%` z#n+H-g5vC$y}i8#NEY;D*Ad+lL3hXC{gXr26&kHl`>Y>wQ*8N@_ZVZH1-Pv7PkIDG z{-XE=_V04Jh1MeWx9I$vX%YkUJZ{h)uo89M?a-oKSPKF&d#PrF?4#sOq(ehLf8hKf9d{!dWUqa^zFS;>~dhihu9H8e<0F(%r#t(MBPs+s!~~ zt@{Q{W_7L=vAGJ6AV8>3wBffnA@j+?!a~A|jzekIX>Pc^c|Jslq}p+dfJJcw=z&{V zm&H~Jn4`gCR#Q<~-?M<#Ba{dZgh7x>)&$3GD!>V&FE3r_8i;IjyY3FkgnD%dT+Quf zV64JKRaI3rtFwy)Vh&kF947*X4#J{_N-Xr97ip$u$244AnP=4W^`jype%=@}=2wq;B zTIT10EQ2<0hD%QIQHDqFd$eOpMoJFKE&P1t?A5l*jYH;`=~&);G$^Logbg>$@uR@q(uLuCjG&H ziUvQ6&|Z^5*F&Jvvkemy!`a#SgP`VvER>Y1<}1$h1~kGRvZ5{-$1^D^GhllLR(U~P zaO2)irM`zJwnnm$0>AFB@ULtXqzkiuwyv5He(iI5wB zTnuAmU~ty=*7zb$x*pej(t22gHF@c{5s-hRvvvVgiJ^^lOPU#;JKywJT8^d$+uV*H zfGuW5tl~m%*NYH|BtZwkzC9<`e=Orxu#!OVO)c@u?c-ozWOO<`J?R6&?I50(rc5gF znZA!66Mai+iz12cZ1%l3pTE+rWfGE+b>)wV0+ay=zhhQf3mjh0qZ&TzceFxC_}#)@ zo-hgmdFdH2S{om?x(<#1>btu-%ww%@H>8$Af51GVNOD!RG{iw{LrvI$y& z#5r+~+oVGWYwhW4HZld()&`W9-7uSkK^sj}gigE-LZjuAa&f9->UsgX% z!A7`ZNpxvC2NWhQ!XV=Uo`VXM$_>-)7SdbwUAX4hJ_H735ur!tx@1vu+lbJx@_YkZ ziSLXYerfEHa#780T;1^c(I~!~$cPlivPhJQsvdFMyMb5^7s9@PyVCCh5F(-yav2ncidrss8az>N^_=qCzp$vh1m-7Z0> zs>vLV@xrr(M6!&TM5zDK+Vf|UGB#pH5O8zu{zc1Eqp%7&~kx z6b0DgDcIRDzJFg~^EflEw^_p#a6e(___I@Ue&8C41*^dl=@lzY>S-qB6~qxHuMjRSF5WDT-))xH34|O| zzJ`Q{BejwG-E2rpMd7m>An-y8rV%Hs~%9IH{PKaaO!9MYDxFC?vk>df$gf z1w{Bl#L){-0#INQH2xJ7C4UC+vG}V%(~d?Zg52kaU6D2ZxeI#&0o+){ba?b!08oTQ zMn;zZ9V$suH8hOLHuB_lJ6hPlp93y$WZZyn7{EWLW#~%)3?GUEQ`NkjVZpIG6@GUW z;ahM~j!whXIjYlin%6xqj&hNQv%a_9|BenjeGeNWdF_6?{F*A1H+4H%4qsob*s$6j z`LsItH{)99x#({%xU2uIrB~wkGK$KQx*r)fH$M|UZhmBRurFhtG z$Yu+RK7`Cr8qa0t+eT0Nc8M*O16eEH=Z8km@F3(um>l?t z`(|M(dyTR@@>Z+pIeOdLU$OmkEC-eRR;x`_-+*F>V$aXQ-rnBajfHdx==Zu-(?!3M zTRRcIetQQoUCZhank&EEEb5QMQ~s~qh-vG>mnw6--NGXN=XzIc&$^2vg{lQtrUWNh zLjx@*KT_lP1kGgBNle6BUe)9=^nVLzA&bg;2k;b9pMOI$jeFt&lQ{=R9S5aA6VzbA z@b$W=j;G>^6`Ooihq)jwQ^x#4mu{5%crasZRcut@Rst+EhsDMN+;bYc=|C6|p?WdF zU~G%jj0cf_FcOR2`Q9dJT@?G8>>;Et-=d^2@AhUC@>O&{mS&;Oos7S}>i&0{0F=g6>oepd& zt|%#j6Zh1@!fw)z<#~-?AORJ6P1o|Wa>9b1f44C}q{%;8x(3<;<|`Gs1^Y z?X%L_Kv<8q+&X15HTiM5-CW)bfwx<`*^wf382)yPf*P60=*iyn+3Prn+3j={l$_-$ zk!ZBZVL;2}7bOVA_)GZM`t*pfUih|-ki;k- zMEwAjBL!~a^Ig)a7#m;bS+9cN1vrUWDtE!_Y`+FGf~Q@D%bLqv4P`^4qdvmI z!hV*(B<*q1|(hL)D}4Ff|E9I{!n zZeZy)EQlt;z^^`O|*m}I$Adn#WeHY_^f7)rKYk1+gK5!!nTvEnmVT(lfi-Jw(id;=lHUUni+pq;uvTV8G%iKWb5uj z^6Adb_Vx>AMzj)L8s4z3C|0(XJ|-@RBW+`@lawk9NuHaK?!pGO~Wqr z5Lx$l&p#hc>~sO7JUh_1y$zfb?QsJhA7?Mkrt_-&Ja1(v4Et6%tzo1TnNV?Vl$Dh1 zs}ETi8G*OPtM8XYsg0JLAxa;c-8%W;@hj;N?S_vyp|8oFv>^VopV(iHV~4fQJe&DS zhvI^Q?M&dvKIH{Bm6}D^4G(b;4nIKgFDN^7?mxlxcD{C#2#3jF^@&e;VP3>b7!$$K(?H`SV+4me+`m z{qF0xF=yIsy7KD$K4nd-UI?R_C>YVkI~c2dEL2o5`BKqdoSXuO4sLI9ExZVOl*=n) zP5DGhXt6-kYw#OHVOe6jg}(3XIMGq7 zbTn}wFvRx}#i1J2icvg7oyl!7@SV6{4Dc~@Mfe;YUbxbNS6JF_;x$a_Jos2)n1&}`V**$a`7 zkW`K)&i1RjgzlMMymHY8JJE#P&=gfh&8~S08cgb(cDouy zxyfpo5KV%Ic%#5)Un_KUsrsh?G;j$Cw(p6QvcTj$s8)fe-bgjml^ZN({A-#XgH5|b z7#3tfsw?$4Vd_XL0R_M44hc!N+Sg!dfi4Fm-gs1Z325@=7O6*gHE_M;`?$#o9|klH$*12l z>kCEg1DQR!aA4mi z4`mK?c=HR>qA*VuHaVcWEQ@CUju1LEE-@p_|7lHR0=#q>{w0;@owb;jg&D__S@E4{ z=K&IihO2+*flEcjhy?9>Cz4E)VtZyoa1J!`K6@K>MCHwT*WT|2dA3&{##cKQYJ3Ie zD)kU3dvgL|K+Ezt=eE6zvks8-K|Gr-SO|bZ!RbkqFBM~joj1shuelMbI3L^muN4lI zPdteDY~;po#ooOOM5KnUhBAa^qb5g!hfRf%`v-|qosW$fg3L_bOy|dL-0o(-c9PbQ z!7^QnIj+ddi~2lhbE`Et$Zz4Fcn6DW!Gru)bJg#-Vg6|r^^LArpd|A7`MHduqN|dv z!-h6nE={d*tbiNE`01qDn@HL2I0!6-Xatt%QEVw=XW8X4BlH5~9kc>@F4K=mUVXBb z*RE_FcV=SW_v5!>Jdo#3+Mcg%{4df4#zcM(h|I0^#BwuS!$Lr@`cig(Q&P3a&Lca7)M<_(IA1V>EGFE$ff7cV0w|v-270>C>ZEg)f{(s zAK6eg{kzewEw`vr)~=b2TdpO`_S*U}LsWF&;ZS2%bXan1z4HwkbwC)oc2HrkS1U#+ zhfOYRD^h$e2la(f`tBZ^40JbU5Murp(t)T!{{TDD0AonGDFH4^=N=nr=PAVSP8wP8 zOd=y<7ZIzPSyFVp$Y?d#eN7Md+nz2VIBG@I*A2wwH0sQ|1I*j#2?z+R0CWfMeL91P z_>pRdLJ6CVi>RJ9pvG<~Ch|Z2m70c{^ywn|dAaY{oig?}o+RFK350m@Ks)*3_Y2Cp zqnJ+FA@z~3ey=j+M;|)A&?UKrg4)R|EKvnxlfdKYU;Fw)!8N=j-A2Wakgs{<1%K+G zL1`QN^XJbYiFwR!oA0s?w{6#}iXab0>YaYNj+)sk_*hdNQoSbo(`%3hAaZe2Kj`HV zNZ#zSTrr2dh9`;XBTfYbC%^-LI;f%bEC`J|_*S#Zki_hlEI!lOI@!;}ih-$Q9_l!= zLBFpkh)^=g=&(`5hT*XyjDv@fX-j{S?HjG0pB}GBGlX#lPfs6VmM=StlfICntA{@% zX&E^A=fg&)rE!nizIb!~`@Z|cbr;ULOg4ciaq@CA{xbsu0bLph42KvshTAqd1Y zjWQYzb~*$a9$@YFHge6PjDh`Comk$!PE2e|dvdNeVQQOzGiy=sWe0zRGpLRueMC_< zR=Z|Bhfzc90zwfOWTR{{9oYuH_6wqb?_1L4tYEBE(t_XVP>nM=>t&rfUJp{<>SD;xP5-7Mpt?q2hi-0-@wlvuF_Q_w#4;0wy0tZ~#ve6-dV%IQ-3Q=(kco&-(AD_tg9$0Z8YPl}fS zG5OjO{L!3Z2%-b~f!tr?lQ#KU$IO>^W*IjN9p149hXrWMDvGG#Kndl-FYxDcn))~1 z5^v10pF<-fZ5KP~4q3#u{BUh}PcbU10mUCXJnB2&w6xq}1g`25rszA@oRUI8!y|q@ ziR>F0e+&qYaif)xlf;07dB0HMV!)>TPmFWaqY(~d0+1rJv#{`Bj`RHl2^@W2$b5o9 z{K;#Jf$qRZC#iJKjD?KED5JG=BGH570?jy_O0>2A;1@-4cvo(vh~o40&#y^6tmhb+ zJAN=#86E!7Enywr1K=qLJ$kfwDYQXQ53S%?H`UkJIlPcXaW5|~>Le`zQ`dQx?;Sr! zUh{uq(hfR47(e_%(*3K8Kj38LsNoF~xtqjON(b3zb4Fd0r}Rk`zX&}SL`baQUzL39 zFnbgbVD{;(n~d!8k`I>xp+NUSN~OR4?3md?3gFRUAAX)EExVn&6+cWZ>T2^Co`Cf5ZdJf!RWwsK4in^({owwL zAgQ@F9Q}>V=Z3%Q|T^Rx36Gpu%X6X;IAsFcI&owqT zq^@&CnE;Ra0;=9(dk&imk|e8NZQS!`I5R=`ts!H6BhyzbH|2Jw@y*T6RdaJ1B+$OK zyfjfCr)ubLYBt_g{Rs+!_K^2WBCzBy(g8kr>aXwR!S-F{IL+$N`;Vj_{RjE?auiu; z1x#2NCYXrD{?LRuNJfGuEfz|6K>=+0^V&5!(Gmm4cWHv#TSj)D1xIBcWvDvAP?Mss z2(6-uWJQ3>>H+A2uV-|3juOG>5f4fmz`_75ssHVTQMK(N2f7|Pezmb>>jH#o9lH!k6H1j9rlyA3Y5deLvZiSn(@7TW z!sKxucYcV`oXqMGR`!#mX^al-{V&aSTZul~6RV)SSRT6En%6I9D&~T!zgN3by<^Sv}j)$;jWOx)uXJ8OgCT$ytS%U@y5a< zBKSROy<0Rzx2%fB&y#;^-t+byO$+3I1aXo|Rq!O4*M^q*`i$lJN&d^i^@*6?*T?U^ z{6n47H6}}R*7SzN*Dhz@;5)6n0m`5GH$`G*u=`$=3QgjF20*}*?*@3mi+}VF3Xsfv z-qgmWUAOV#g zWMTD;$|x(pV6BvN=4M=svRyT= zoMN#E27e(|#Dr*4+4Y#xLu0_bobwy6L5=v^(U(DJ`~}Nr_gnt)@mE(Houb%aF!c*h zzP-&Pt+NOvut4{s(JDM;iY{LsvZ@9jgq7z1tF5O_meu1`|ItW$tfzFv%RC9<&~b%! z_wTsv!$P%<=TajH9|@>4c-e|T5K6r zJ=J}&Pc-!XS9q5k)9P>t8t^fZI)n6vVqz;u_iBf?x4ws16{`VxF8Rd>;&(--dp$(5 z>Sh$dt7V`7#`#a->qV8nD(&|qr|*93Dt3%GM7J?mK6eHZZ}1F7EG}i-m3`(-d)jZG zr-q>&G-(zvuiaFTW8$N-`8L)8WVe)BRKiy%3IhSGP*H4$=koTt#pF-AOPD~sz|Z=m zuLIafz4pYSve{T_!G)fnsHz}9o|n0MNf&H^I7>*zbwfCsaSI(1DG3WCDM3L&OW9r@ z2QHIt;j(-;=G|wvYm8N(s4>5OJv$#Hd+9(}gjP={OAb;y&M_@`5CAu7-W!aBv$07O z6Bnzlo22W^(j1c4DD{52ZKIAmTk?f?$7XAPjOzHo+_c89x0J-CnyrWbN{UBApd{IYIx{y;$2l4qF$)#dGaxfDT z7RoyxpV_=)de!C8cqahJ2D0bV{JEDFlY52g?%Zz4P5`MYNpi|ssvr3fwP3@Wfnuk13olrTH4J; z%jZyG#qv7ccQM0XPkNSHJ_#Lu?cEzH;WGd|r|{i&-y8__7Qm0$QlCb%dLj0!x;ppB z#sx1%t1~70g>42#u7-w&y7T&x(`l{LrO___$sqA;1ktU1FGXdjS!*eK15GGRU~c|r zZ-ov9;pb0Zy7(sEiY}Z&e$?k%|K}(dO@X_#fw1`e_-pIV@dQM?_L)z2lXPUE4Qxs- zBG#&>T1K~nQ;T($gRltlBF_&O7fX#IpX|QEMz1^FoNaK@t_l6Q2axu?%G6;{@YeA? zUMrzf#nyRG#B(0lXyTKIH)9g>{{!}u#pJqQXb&aA2{JrPF^zAS?hiX?%gmBDV7p#n}u zLr8ax0{%|blG`u~8obp$(}8i()Wii)Io>y|9L#Qm*FrZ#({hYjH)u7E=Wvuk5;y=z zW!azkK21jlgL(D#puwhH$i##$?{cuV&Y^X`$U(D0_s^vOQkUafL>cj0!VOrZFno}v z=W&%?#nWQH>&m{|ia-F*h7L`=iZ9LP2s9>}E7!@71%X>_r=5B(Td789MqPd#U!N|= z%$v1|A%broS&;{U5sE{9G_M9)x}#7({LMPfmQxSx&a!`3;~Q@7S$LFJP*KK4lMb%h zO7?oWO&brFZ5&a5|2m_P@eqSFR4E;uTV=OEJnV8H0<>3w|A`1?UUj5jZCH5ihmDK- zVLNP6WbxMLsRa*B-|;D=4;jRYygi=}K_rqe#xp4$ELP6$bR11(r~3SQW<6U(X9CgE z+IFdNYjafin+Axe9cMdsySZ36S$hvJ`eSdp`1Q+8Vr5yK^m&QreTh`BXhPO_gQXvW z_2(w50Qn;AiqIcA?%1~LBT1=jCWZ8W+GXo~qmTQ#)@e~gqp44qQ6clO1VS8q0#n$X z?j7#YS|5!9Q$>V0j-^-VX!P?f?IiaG?=Sa1gJhji8n9+Od)Djx>^82NmYqlRwQ?5D zIyB{w`of$ee1i7dn%4XTPM)`XMUXC9bBqD9NrYz5wr;nMlJon(gr25I;fZhWEB-7=T>4YLUhZ96gWZ=%q4qUe&sqf5pY`E>}|LfR=dgtz(Z_TT07SE z;`23|`+2c9Pdy)xf(s+ zZ>>ut>t15VShNZ#i}+q@fWEv-oOMo0U^o9O z^b*#3nsYJWJp*OlU0ZtOiQSp1_y4eriNxJpLy+dY93*gWVO}-CO!S#%)Wuklbq9Q9 zCjAx;ky7vL`uU)WNMmgK)%L}wT_YcsgJ|B><`J@I^qADLq8Z>M^S8IQe!DZC9Sd}w zrhf~(0k!RR@NK%y4G2)yEPoL=_S}(Gb^45=S4^($6!~ zYqc1NMSeC~+W@s!43CUmai#R!ehETMw{Nv>!(~8Ax%MB%N|*Be^fNBg(4Kq>9ZJvY`W&NUPE$Ru|;fiK#%pC^haE$n_0H6 zw7G2!(-ki%rUJCwfN{=yFC0CR0AgrVe^v?dI=eFElC?5}K-fH3CDJcnt+$lb`?CxH zNIihcL^*8EYi4@Wv7aDT=-=*UilG-hZ7L>-59(^VAxTa_Vd2JD+v$&4t;crRn`1Cv zqQ~K+9oaK`2OcVqF&|OJ=WHWl3)iO8{>Pi`U0m3P^~--J8tcFU9PNZPK*5=>oR7+5 zV?FfUKjT#}#kw8#du49krn%*>j_Wn9hjV_ub$*S# znKO2g4YVo96F|ibu(5%X z_~Cdf2Yk!-0%Y5R!=onk?V*Z^o-~Y!$*$R58GM-G2G^h^W>5^hsCoF7ClhEWdTw z^Q;HqH5hl`ET2&M6hiG!a5nOs%E`gZeEh3b>FqwTho5~u^17V{~L6)YCgR-gtR8xD=@hm)Y{??5j10z3w#!u2sPftdQcmFQq^yKJp=H&DX z1=&a4<3p$^_Ab1}K&7wgs~NDc5DN8MF`dVBC$jFPeaWtN@IdCQr}uRHsna(135Y42 zt^&$V8nUrU#_a45x>Xq$zpl$7n)neyCm0`oDhcX`a#wO>4LrQ$}1AtS=9EXyYE}ms2J4{g}9g6c5;u z;XH5QuH?uW-)M(a8nk*syH5?{x1ffgYU2v%1OPZc^K3VoOk|FV76zZq=Ok;4*5i;F zAXF2@?iL+2&avv6o0&~1AC8!}CM#?RE1MtWM$>u6G5(?237))~_m~g4_GH2O#tu3> z-lpS)-=)vpWyR`)K4|b!MdI6~YS+}uL&L-0gin&szjpYUh>JsmUw;vKvRnLoU+}qH zTI?*Xv4n9*&+{HjS@3)w)T!jOr6z~bnR5a9;K{^i`oUo?woy&t$JKRMPO+F$r$id@nDTC{C=4otogQXVCH21m)S^ zzarnSJm0Xg4t^o?4VJ9x3h(U|2h%6Mpt^i1x;IEjFGJg%|9jc$KV7Ws|7m*mas3bQP9GwEybZ310ryE0VR2J+t!#sXyj54U(99r4O10@7S?U4YpMGXc}- z>2^2YbnqWOmm|4uqb&i;N*hTx@7n1aS#$F#jaJAm=8f{x&5gD~mLSsBKx{<=R@OIm z`y*J;Q$;@bn#fwcq90Vv;7z_#l0dGcf&)dI$EUS#Vgqc)4Md->Lcy^w4pAWb+Mn{22 zf_2sJ-tI-U(egZU;VWWdlyD*f0|Cg)4^IEg4Vci+2xuRGc50!`oeXqgD!>5;B9^~= zvw8J%wVG84$Mz4LUPO?cUx?$O>E3>*~PFiPJJ)`EP`myb|tsMJdc_IDK z_vHVR*V$eVp~#uPLVTI0LoOmBVzo-obk8Bk_od9FS5;ry|424A_uZGx7=e@KT$_(g zynR=2Z#AZhFeXZN0fdI}47iB3OR%Rsxelj0gwTYBM8JesBd>NI(CX)bUY0{KGkN1e0bFLjGEok3-cw7ojtP_h^LgE%ozg^ ze6M8=H^F4)UxDaF(@3m|D53cbbs8y!NN8MbV(Vw@Nl{TK%U*{SoGi!g!&JJD_f{G+ z+(<>zqF@3M-@2}@ZdQ9;N%MG$k)P+*Aeq0QLdxM6cjb0^mHlQi`$*w`h#22%4^_-7 zjO8WlQg!MqHq&}O6aMl6!j@c{6mn{r!%22Ziu)i?ROy{8 zw_w?NGGlJk@wcz5lI%5G8&uJJczKaiFa91$@wyZE*5-VFsDz^^bvj?zavuKpG5C$G zW<(g9*$_Gk0gsDRm0`zDz4fO%TndS3wX;F!5U_#X52$x|qd=}gK~Fz?Z3qNl2NI#)AF(j(n>RwGknzDI2NI0S0tLH^ASmRh zeSrLC^Cn6xq=b_gh2RGcdj=04jaye zwp+r>iveWn6GFr4wz4+!*=-e}MmM&3`x!!2w%G^ADpNAS!{#O}qL5v+V&%LMY&bS} zSj&PIjZ1b#-gJ?98G;ebYZO~QViQ0?sW#zw9^c`8{qGDqR9LlRbodLY=bQ3BVA~5t zHx$>`*UyKGs;zZi_PJm_gZKVM@E%dy_|i5B(YkbP(B%kDR8%|n0oBfKdv_N|)lR+C z5r$T?7a!NJgDiuanDF$oEnyPm&w73Ae@3IbF^ z8LMtus_xYNEkmcY36?t%$Y+V`9oz`-eiQ~sIzr`K`mTYeT}e*N_mId*gfYPvvK$xZ zAIJ9JY^pR<^fdcK(C_#!TxWC{=dKc~se?g@jFNmO`5UseZd4G6g9`v`{E&Yq^h*GY)t?(Cq z7SNm>2&$Vkyt>} z;oB1g_Z(4Pi)fXR(2Zg1D|r3`i*cr_rJG_wBPt>~x`IbIcc#{S2;R1!DHh5UEL<0XpdoUBIQ8ekbWmRv?zX*@HBjfy1&3XHxc?%RJr>*@-nKQZf z0i)q9SkIgqv6McUCo3Ethb5I#*4E#PU(NloMj>A4QvGEF3RP;RObxhqqCqCrSw_7T zB&=eLoN`V3Zp*Jf2L{?rt0VBCMxX=s*mjc$OO&bF@#*mSm4BBRH9ANvzk`cxJ&XLd zxLj{Ny>1-8x&Cwh(4krQ=+OOiaqE+L`;&0KlMW#aJc>#>F>Ep>Ecq+w1SFKe)tYep z8DZ4kCt-M`I5PxvexAs_9L{OcMh%)U6&j}M>cy&Zh{fOSVX7Cd-phLRfHXozA52d} z-BOz2K^MASM*ehV@mfnuTmq0jS~tA4yh)XAS4kskTdkR&;n9M*5H%3_3Lg>@IXZfR z4U6dl@#7qcXzIR0`s!ykGva3EQE%ilAwMc5^LE#-;E){IodwvecQEYw_CccGaU*WEGG}y zGQzY{*?~tW#2B5*cs!aWfSrWHIDp&)3Ox?K54I2bzMdO*RFAKT#Z>j>eZy)bRD#!E z1*eoH*OJ=f?(ueEdCXyD$DF5~xjBwS*CogMwnEc`83Z8Jz}1``DchM%eHr`_N*+X! zh8u81f-Ja`U~TiER)x2J{82=!6U zfnP`1Fzfg*RDfvEDpouH;jGl@myZ+f3y|&S_h)u5(HR#6^NW2s6gBhMB=dt~O^zPd zAYlIhOU+br#}zsZJ3aOQ8+I;v%R(bzrd21`yay*HQl?i zN``GVYHpy}32!rad*XDsavuSlNEFZ;M6>!Y0n6n|yL>BqTf>n${UzLR?yZa5@YnQoHxG5t|OVHyl! zx&hXbf4gLrH^v7qj3B9f8B9&X z_hlS{;x|?^W+r=Z*#8?$)nQ#{(ZS_u?k6S_{qAN!DtD_e#V{iNeGIyIl(EGN#H{sv zS~QM;O2}5IR;<)%uRoI9ai2P$Nlw`>Mjoo}30oK~7BCDC4ZB-FgBX_xvM>waaCK`K zUyc4Wz*zk?7bXSP8MrsS90I(gcch(9RN{Qy(D2lVOw~Zh3eZs_YXl=S2LIE=y-cPtbs*(!A!ijSVZ?h2 zr^@ZLk~%yM2?HTrQG-uh6_#t|*%d>3nL6C=C+%=Rtt$^1^0c&;_rG>Be_PE(ZrmML zXP`c8}DZpsXI&20LN;D68L+iwAtIIvrG1mi+s4Uh<8qE}(?^vT~ulkfK zO5r|=2B?_3XAouIaK>F?Z3UwXCuAgIV$rSsGd~ObtCq4K86Xws>Qs*Pqx4n1kK@6+ zFE7#-VY}b;q}520j$x9m9};8QV)~*Pp@xFQ%x?q&^%($O#qI+1^BZi}1Vk%F&vc%yYa2Q}ubbA-AnW$%Qj?vJEMdHv61v1^jYCS?q41CPS(XZD;(~w&aI*aE~0^v zx`oCn_b&R_OBnM$Pnf~#`#KFR%VRrjZg{*uy=NNaOX*;?ajWC&*=X5ex)fWWr_ekI z-Xs_^nnXv0avn}7mZ&CtVDD+-cRWp^3+cQ@FfT*kE~HqzSUFiKwcvqS#PQsugUl$02NsI81-x#jmDTTRze4{K^#J#T*X{7^s2CP59;O-FXj96iX6`Oyqh~dJZ-kBh=2z3y7 z4f=(SqaD>($U=2HZ<0-AT>xfk>!p1a?vVa%6VLpN1&Q8*iaOSFzZ@AGGu#mIH6KE% zBBHk;pV+woO&TEHUkB%GwFraAV7yO;UIc(2e%bso)G1}Umw4D0d}uL^^=b~67u>25 z!xDla-+$$P&Ve?|u74%R5_O0ew`oIO!s!coW6)(28GLB~w1?1-P0F^!Z0dY{&C*i^ z*x}WQlgYt?x~gteqX(E!u{bwQD+)Mme00(YQUSN4<@TWE5I23$s<#@5COiQjVexMGwt5W&=I@{fGWIxc0QIp72p`cw|Ql3THA&jCS6o(uJ! zFj6t3h0X9WHk(zT$Boi6E@-qW?uLg-3c(>hDE|7}IQ-XU96k;n59nq++;6?3PlS0Q zW6+lBG>o2OYsFXU2sxat_I~FH*&lge7%whT-wVrIwB2Xu?f@&G$I~sIme;%*b&=Dn zL9Q5A4s~_)AC{IDzDH?Y+xHO>%=Dq|R|1QsdAIyjVM^j1vVsqbmCTj$oXS4_;zik0+Dz{xr( z`i3)oKDITNT6%@tPN%{(Wa&{&+-`ZVkzLw3KYAg@y zK+XT?_*? zSB;)YjEggd%tl^>l6owlmA0IU&sq`vwMY383{(m(PrKHCs??_xaXE#8AR~&B-Rz3B zoAR2Pu2`!r>odKQkojQaee8gNwq`!U#To|VrxgT(reBq0-arhZmsCOHXd!)zU{ zS>ev&XaYui1?UId$8Tvxopi06dzu!T^hsZt@cmOi1qN$Ji;{y+(KC8@!pXq~1h&>8 zNt90JhL7m|4ab6KdwRy<5t0#HC+XBKoxGo%R01QwGT+BhheJm{SZVE6KBDz~RU655 z*?0O^0%%??7!@ET=qu#yH|H>LgEUtn76Q z3e$|w^%K@2pRuCf{JCsW4La}dkZZK(iiNhah|{;gJ@J8`8jBO9+h|`c!`%EC?&Jc1qA3LFQzu#t#;u?%5L=6QutigqP#qx4UnmW~s@D`sUwj^$cmEsl#R*S62VZ;x-OV9Ze%=jI4&bl%zQYWo}9dV^>NG9&cQFm@P>S@ zd6Q3B65WelrSZ}@NQB}(M6#E%?>ajA!7}s?8{6v~UKvogWwz=~1^+lu^*z^jlr&NW zH+#n}x4pXW4K&Clfz|TnUH7@!7US2gOKc-{n0$B!Fv#>eX-pr-<^U@OR3Rg8 z+&oY#|4go?e?w`279_pmF3HEmzWc||f4KO$Vs5iur^SDBt52^gsOxM>Z=z__!|jDE z(-VyAIBmqWDc_{PgziR7UvtvOcRV#VrW{w%XFsRHh1Iwv?q0N{r1R{0DQAB4uL(#s z$y*scReuS$qW-R)DL9#9ctkNlSjsBsqlxpDtfxX6jR?XV>j|k8jocha>W~t&KC7M?v88q{B zY?Ei$Hc|zN31F3)6m^$FB!6!^;_m?Y`%4F%gh(!e?rMXme4O1E>Wt)~`te3;dPlCq zJbAL8r$pIQCVp)&WagHII;_0Pc^#Ombq|)5fL`W?&{@E?E&qIdNom2t$oSpQmY(d@ zt5=^tv?xbgf~rtoH0$lK5KXb~yUz4DcOi8QLVE`s!mieNXW>WXRDCQA1X$?N>Hs;G z*oJGZxG)pV3CiwYXX-@q)KZ!+V+D=;!G5Pw3Ih!xxP_C5r8witJr3A-NJe5$Af%&q zlnhyc-gjQPIxP97^Getri!Jm$&<;(J}N|lo`4dEcIjK_D810z)C@PAJ2R`z7F!&Ad_%FM z73~W%TpG!yG1>%&hwP>#g_1c+Vi_E|=afWHwM9!6IxIDUmmOy*->YftBN6+}TEq3N zVtUgD-%e%tiRH^#bH}-@{_mgItF#{WNU%gqfcU92P)03tHHK{dys?IkxH?~_Ju@Rn z&haZcv*y`Zs>fql*h6MoN}RsRo`LIk~|Spycw*es>v15V9#M6r zR>4vo676tAr@kx%;6mGgPDI0^5*sCI!fu7Ip2N`F68u z@l0R9~Pjo`yd;Kyq%r78)-$$Ee?x8 z`36jw8(VKo_zPFln8yy6vorSi#c&VPN$6?$r~C(rKb*aGoc>QOK1Z+S_Aah$a;S3Lw* zk+HeuItmx>kb>Za5L~B-W|DV1DQ>HnF-Is^ zn_z8%@v`%%)Pzb<#*JQ6?U9HS{heLhSPHN9G5!)!?g>*f@;dSd80tMQXJcnRTak|> zmuCC=&lUaWL-f6uhv4?s1NS^QJ*dFR^q;TWA&TH5VEew^u{f*0$C1i(bUjK%O?_)9 z!Mnl^_4}=|U1Tqjf4tQe^1?T)TtkR4F`SA}@Pmx_(LNCo9g@Sn*#lWtL41VN1~g0Vpv`HLU%mT@lyNId`ws#P2|G6p$DRm%2ZFj)2{Dxi@3 zPG2t~Amwc)(i##vcZ}mW&Q;NdGO(9lHstwBjMR?DL}n(u2GKe~5nCX_oq~?mXH+7D}7?1Xmk~@>3=`H$VfN-%ued;)t%{L zxpAMyBcyq`10H7ddO-XcL|_Q6iH0wJ%uHP~&JUO{GFy;dooo*}97R!kx~G$t3k!sr z6-)Vk%98*V@BNdL6Uxa%?)Z43zTCf8Maxtto4?Fol=U!VO{0Y>6-o*<2B zj=GQlt8|bWAO}x8JaN`nO9%}b-N^q8Ree*OBUm8CZ_{~DeE)r_St;nGT9|mkA*g=s zvN`FDX^mvyR`R^J;&m$dySLI~Iwer9aY|swvuZ=66yTpiUjbl^%h?-CQ&8c&t*OfN zpWXk*%m*QNm!t9nV40Xo0XGeaT33s{fQI|sBj^vE0vNiKwGSTYH#~VW9IlgfGWT_6 znq2VcL{m=5wu`fV`74chXix*j#F<Gy_7>vz9D$u~E!yt-aziv*RN-?i!muG^F6w6G&NbRy7ub$yZPIk&rAKNG7+@+4t|_g+OvX?)mD2oo#TJOufy&-o2x7Q^jS^< zFxB%PEb?GsasR}gwUxlZB-f>YQC;-bl*)sl4E)vdu~%iYzh149as(Lc#GF?J7@>v2 zHi<)G096?zC2gJ;B?||E!$S>N>pJd8W<2SmJ#e@~0NGHF+)NHk&bWSl3xYdQ`R2<|-lo_s%yPu&tV# zKUf6jYCu+9wT)Q%mhe_jB^m@H^?i_s|39yqbq%_Vi|BMY{|nrC3H6Up?Kx=-m_ea)K7sK!7$0+kQkwg0)g9f@|wc(|#O1njX|sjXjK?yT1O_OqA? zQ!id(Ic<{S73VlXv+$sLqCTx|it#ZdSno1FZyd<_9j!^#_w|Ilx41js`^&<~Il(=2 z^(FdqF5yEOrXed%s>8QZYJ3*`G~hYl$DcACc{fIK@@I6!lB{Qwlg2cWR_Y1@$j{=* zsf#E*tVh^195rjnh7{&ybLUx%R8K0r_)AGWMMtKt>AeiyWUv&itcS_I;o;?cZ66X; zAHtBiVIB6q|0a?DWag|g$x#hPKzT2nP3Z~EW{U)qd`Pj0N0d_L$+x^4uY0&jl{1Q6 zx$ZfAxLqG~n%Lj9!efTOI1Sww?Ct$emXN|2C_*(T&kTm0dmwYZTM}OhMplb>wbBDF zXs-7-5?^_Ec+g{E0^E357($DTxnNJ3n30!D z3QKv4du1;a0vhMZcy=6GU82e#yx@PZwlu$3on5T7uRp4Rdnf&1e= z`b{GO56H6>=gpn^jYNP-bNcr>eHLIakw!eZw(W|DPak#nKZwR4IQVDDrwC)fPJnKnkM?fT75^<^Wf1pr&y2=Hm$opEl+@=yEn(gRa+1M09GGh2m)W@Jy zGRgcW-`M#1J*p}%VA1h^!ftBcdrj{s5rq#}hF->A^+7Q-*lS1NXEIQ1N zn3xKh(#&)cU)b4^pA?4OZnHt`bo@7KgH=O@#@f-Jm?2O-=(8+5>T&-^z#Vg)bR0AD zV0|bZgNmEoiv`P0F^Vz19=emnW`i&KY5$Y#M`sMke2(??F-^}d*#I}7s2gN~r{jk}cF#NR)G zDrFEN%cDU%wTU8jgLd}az$=kN2XRkC(#0o1ltBD0tr4G+Ex6xAJ zEheTwST=i^#5ZmDp?Jy)9;+&5e$qyej z*Y{T3ylHVNnP6-QWmSAm1gLeTFX{Reb+WiqCA8XDSy+belhJP=)x7U`dF$xzo&!A7 zW`b-;vY3Zp-`Bqd4gd}JhZ@A=NaNd#q~>E^}Vn&+V;Z^pw%jE8Q z)0yEnb(Rfs`Mf}m8~CFSym9hf8f@vbO;sG!9M~k1Jt-<>Ac!Yc!ulGyltRfEWCr3b z$uXrm1SP(L;*OZPC_OuN!ACH@xf<$#%pVSla&t7YK^L3DV~WGH*>8TIuBz_kL)NYXUHPyw?ia30LS9*W zE28@OhS=al53}{@XmZ!AYklQ*)UIk2`TO`GA#?^fY^CL>HMbq>73A;PKc0&fne8Ei zCQA8?WJYG*!6-`|A0Iu0MZ)a`!Lp?|1|6p)NE=>lyrW|JnnI-u1@z_@a(%br#BDSI zy_vXis8+j9MLtD0v3z#8m1HQ{rlrc-@I(Iw^lZOZ#rc1nv4{R04+ zI432sD915e@!tJhe&g&l100P5#>s)_zI z%n^SZY%iVj`@5w4?wlI{pUdcW`PgYau9uT8=oJYxH7nIIsB99LG|vSBDKoj;bVUKn zsxR==Lw9+!Abi0CndX`&NQe6K_!;9|n!3~Nf6dX;dK!vc!v`;JBVv^e;u$n2n?(>7 zB`838>kVIuyY9;Q;JQ?IG}~%_6_%m+S>1$g%gM*5s$7SRj10}%aT~)dezFEz&65u( zIV~i)TTBB!ER}$e2c`k}&FrT%$@rsW;e-t6sgGuABRaTjGJ_?PhFzQDEf$Ub)A{d} zYulmglOVVj+b{678ceu*I5P8otQ--mxXG}xViv?EYDxvkMa~EW}O z-Ye+5gg#)|9MNfrf7jG+<8Dh0r_yqZ#DWY7rVPCX?oTIQe#zK_w{=jkUN))HihRhC zeaD$#h;a*LD4Eru5SP+aCOFCqa2wHM$n-fT;h>tqBwz>HV98BwHJ6{_EP&Z6vF-D0 zfJ9?_l@FDY?0990@w^Oo1~ zYyw~p&LjQ9Upr^&&%liQP-bJ}<|9-1|Bu`lbpC+{kzHHHK7&RqlNMx!e>do_(F6ik zqyA;O#>Nu|YlU&zZ@*fF?5^b(VBvN`WN@o~yA1!)FQC@XtJN8)xlIp1J>L9%*sQdw zml^i$@Oh+A(3yW9gyZGsgWrW)=W28F(nzym8|YD;_2r<&Z+$CL!ECSd#t{V@bli`X zprEFPIs2<%xIy#mY%__Pwg!5|TVnZ#9!mCzX)40KaQ;m3eNLB<1SEx7VGu1koixrr zI?tx0tm6XMlS}e93(q`zu>^L#b^4z?^)K`B_4OY9LH)6z>sWqfmlC!3h}(hSp#uNp zS==Y@I>g$7YenaQpZH;M(o>xf2xgqt%$$Qjq`D+W4{uY1&EKQjEZvH8EKE10j7mRd zLzdS})gGQClK9&&%}1+RWquO@iluM8h7}bWW0KioAQ*O$<;bz5%o(>~GCl5IxPXz?WenkK1k+ns)6Ru4IpPC@VJ~bU; zqV{jg`L#+4Ldo^cq6BK|Bi@8h-P{-3eRrH0^jr0}K_V__+2l!vvjT1hi$YWJ5@zPf zQ&mn@P7MJ>jgb)Y0nRs!xMq5oy8bGQ^x?u%ekq+-6d%z8zOud$bwpZ4i3Ex|Nc)q* z$W{1HxkLnIudxfcCIa5+mRq-W5m$!6p{s(<{Y{k~z(St^wGMt>hKtFD*DTTNvQdvw zFe^^EP5D+xHZyui>6oN4{6?Iku_zhyYjdkfOdoBuxe6`~9&&pQ0bFEKw zWxls(>wU9mw70a*0dQ0NoM8|2gvrP=L(Rt-zmf_KrCf5q{Mebcnl$_$Ru*1P+#K1W zG^I3qRq`O8Cnjrmhd68j-8RIc74G-;md41eEK6mryc)tgm+fFhCvI<=d~0G?behYm zZT#>kzPmJ~bH6BCQ2n;oUm|C>C$M&A%)`nq(4#G;vzHB+(-6%eVt+aU#emxsBgzVk zVn>6%Iw$sU@vt4}3;vl5n*8f*cB3RfT>D8MJLfNA-fuZXxJB%_>FLOgJDmd8P1nw3bcx1UP@}2@HJC%mfGYUvV^p@T_;c7mg;PJ@NmCG#33naRk^j!RLx|6Zd8Kbp`AEG$h!AxrOmT zYw84F6Pbm4t6p2E-0U}Y)^|cSOLRDvtrHNOaQ|3>@Kija(7%{FUOx`Nh3auX#S0ix ziq55K`0;(B>2mm(WBM6Yn8ibJaY)RB%d0%Ju=h9>|2xeJWh-LDa$|KQ@rwOcMn-BtAVR(i9B?w?rMDJdU<)9T6U1ezk z-jFfs>!U5d^uP2#&gPJ}n_{h02}9o3gk}!83zhyClT9`U$3-N0JA3Lm^qps6I@ETm zYRDjYXmgdUxV)L(+4`#CDnbbHoH4OlD(Id-5x!QONyL8>ns~oi&qr>4@2^J;6zMYV z4wcI?7m&?#lBADeDWT7TKJoabf(Sq91suxiw%yAZ8%yuDsxZt8sLH1nee#zr^jx(=m z%RI`fGSgFlEHTH)15((7-^mAWiPk)WLm_ZQbMgwqC^=5aEA6$($SUG&zugbjdBT%f&!<6Q%H zH=EXy+~raUgKOqLtdUgc_lq|!Me^TOL!hkP2lsIfB%&=rS<@XBAHol3oR`P1ByYzm zfOF8;6}|181f-FK?KMN?35QFk^?J%uHEbQ@K5RXd1*7dpFp7TdBISf*Q4`0=95TkJ z*{c-x^8MQ+xA|-mWNW$~oxx3=!D3$=$@i8o@J_~+7d$=^=~h;YktmW*-ra4h08(RJ z&fu_!a`&eoY20ip&7;Pr#0N**q%EE$vHS5Rrr%Id3D(L$(y(h6ndRe}@)!FmL0tL* zRF{h)9Qwpv3v388v<;+1ME-#>A29!#-(zocd{2xo&tj((gMkxou3NHLH!ftsS=Zvw zZF0=H;TVhA_$8_@bz_t8XIe^GN99G8`tQxn0iilC`fiTgk1dw>(Tzk+6;x**@WL$p zQJ@=Io%eHxSx1DhthDCrfpm^5Ja3haq|<#f{IXm<%dj4_J?&WHw){wa+M=mloIHlN ztJx)x3A(Ib!*TWs#~{7RLth zSAATi59wgv`5q({ru)W61?xhx){GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py deleted file mode 100644 index c2d8f20f2ad5..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py +++ /dev/null @@ -1,221 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - -import os -import time -import atexit -import weakref -import unittest -from dateutil.parser import parse - -import petstore_api -import petstore_api.configuration - -HOST = 'http://petstore.swagger.io/v2' - - -class ApiClientTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - - def test_configuration(self): - config = petstore_api.Configuration() - config.host = 'http://localhost/' - - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = 'PREFIX' - config.username = 'test_username' - config.password = 'test_password' - - header_params = {'test1': 'value1'} - query_params = {'test2': 'value2'} - auth_settings = ['api_key', 'unknown'] - - client = petstore_api.ApiClient(config) - - # test prefix - self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) - - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - - # test api key auth - self.assertEqual(header_params['test1'], 'value1') - self.assertEqual(header_params['api_key'], 'PREFIX 123456') - self.assertEqual(query_params['test2'], 'value2') - - # test basic auth - self.assertEqual('test_username', client.configuration.username) - self.assertEqual('test_password', client.configuration.password) - - # test api key without prefix - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = None - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], '123456') - - # test api key with empty prefix - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = '' - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], '123456') - - # test api key with prefix specified in the api_key, useful when the prefix - # must include '=' sign followed by the API key secret without space. - config.api_key['api_key'] = 'PREFIX=123456' - config.api_key_prefix['api_key'] = None - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) - self.assertEqual(header_params['api_key'], 'PREFIX=123456') - - - def test_select_header_accept(self): - accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/json', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/xml', 'application/json'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['text/plain', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'text/plain, application/xml') - - accepts = [] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, None) - - def test_select_header_content_type(self): - content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/json', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/xml', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['text/plain', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'text/plain') - - content_types = [] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, None) - - def test_sanitize_for_serialization(self): - # None - data = None - result = self.api_client.sanitize_for_serialization(None) - self.assertEqual(result, data) - - # str - data = "test string" - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # int - data = 1 - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # bool - data = True - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # date - data = parse("1997-07-16").date() # date - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16") - - # datetime - data = parse("1997-07-16T19:20:30.45+01:00") # datetime - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") - - # list - data = [1] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # dict - data = {"test key": "test value"} - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # model - pet_dict = {"id": 1, "name": "monkey", - "category": {"id": 1, "name": "test category"}, - "tags": [{"id": 1, "fullName": "test tag1"}, - {"id": 2, "fullName": "test tag2"}], - "status": "available", - "photoUrls": ["http://foo.bar.com/3", - "http://foo.bar.com/4"]} - from petstore_api.model.pet import Pet - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - from petstore_api.model.string_boolean_map import StringBooleanMap - pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) - pet.id = pet_dict["id"] - cate = Category() - cate.id = pet_dict["category"]["id"] - cate.name = pet_dict["category"]["name"] - pet.category = cate - tag1 = Tag() - tag1.id = pet_dict["tags"][0]["id"] - tag1.full_name = pet_dict["tags"][0]["fullName"] - tag2 = Tag() - tag2.id = pet_dict["tags"][1]["id"] - tag2.full_name = pet_dict["tags"][1]["fullName"] - pet.tags = [tag1, tag2] - pet.status = pet_dict["status"] - - data = pet - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, pet_dict) - - # list of models - list_of_pet_dict = [pet_dict] - data = [pet] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, list_of_pet_dict) - - # model with additional properties - model_dict = {'some_key': True} - model = StringBooleanMap(**model_dict) - result = self.api_client.sanitize_for_serialization(model) - self.assertEqual(result, model_dict) - - def test_context_manager_closes_threadpool(self): - with petstore_api.ApiClient() as client: - self.assertIsNotNone(client.pool) - pool_ref = weakref.ref(client._pool) - self.assertIsNotNone(pool_ref()) - self.assertIsNone(pool_ref()) - - def test_atexit_closes_threadpool(self): - client = petstore_api.ApiClient() - self.assertIsNotNone(client.pool) - self.assertIsNotNone(client._pool) - atexit._run_exitfuncs() - self.assertIsNone(client._pool) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py deleted file mode 100644 index 0d0771b57850..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import six -import sys -import unittest - -import petstore_api - -from .util import id_gen - -class ApiExceptionTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - from petstore_api.api.pet_api import PetApi - self.pet_api = PetApi(self.api_client) - self.setUpModels() - - def setUpModels(self): - from petstore_api.model import category, tag, pet - self.category = category.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = tag.Tag() - self.tag.id = id_gen() - self.tag.full_name = "blank" - self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def test_404_error(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id) - - with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"): - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - except petstore_api.ApiException as e: - self.assertEqual(e.status, 404) - self.assertEqual(e.reason, "Not Found") - self.checkRegex(e.body, "Pet not found") - - def test_500_error(self): - self.pet_api.add_pet(self.pet) - - with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"): - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special" - ) - - try: - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata="special" - ) - except petstore_api.ApiException as e: - self.assertEqual(e.status, 500) - self.assertEqual(e.reason, "Internal Server Error") - self.checkRegex(e.body, "Error 500 Internal Server Error") - - def checkRaiseRegex(self, expected_exception, expected_regex): - if sys.version_info < (3, 0): - return self.assertRaisesRegexp(expected_exception, expected_regex) - - return self.assertRaisesRegex(expected_exception, expected_regex) - - def checkRegex(self, text, expected_regex): - if sys.version_info < (3, 0): - return self.assertRegexpMatches(text, expected_regex) - - return self.assertRegex(text, expected_regex) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py deleted file mode 100644 index 92903bb232dd..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py +++ /dev/null @@ -1,442 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import os -import time -import unittest -import datetime - -import six - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) -from petstore_api.model import ( - enum_test, - pet, - animal, - dog, - parent_pet, - child_lizard, - category, - string_enum, - number_with_validations, - string_boolean_map, -) -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -from petstore_api.rest import RESTResponse - -MockResponse = namedtuple('MockResponse', 'data') - -class DeserializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.deserialize = self.api_client.deserialize - - def test_enum_test(self): - """ deserialize dict(str, Enum_Test) """ - data = { - 'enum_test': { - "enum_string": "UPPER", - "enum_string_required": "lower", - "enum_integer": 1, - "enum_number": 1.1, - "stringEnum": "placed" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (enum_test.EnumTest,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue( - isinstance(deserialized['enum_test'], enum_test.EnumTest)) - value = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) - string_enum_val = string_enum.StringEnum(value) - sample_instance = enum_test.EnumTest( - enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - string_enum=string_enum_val - ) - self.assertEqual(deserialized['enum_test'], sample_instance) - - def test_deserialize_dict_str_pet(self): - """ deserialize dict(str, Pet) """ - data = { - 'pet': { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (pet.Pet,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['pet'], pet.Pet)) - - def test_deserialize_dict_str_dog(self): - """ deserialize dict(str, Dog), use discriminator - This will fail because additional_properties_type is None in Animal and it must be defined as any type - to allow in the property breed which is not defined in Animal, it is defined in Dog - """ - with self.assertRaises(petstore_api.exceptions.ApiValueError): - data = { - 'dog': { - "className": "Dog", - "color": "white", - "breed": "Jack Russel Terrier" - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: (animal.Animal,)},), True) - - def test_deserialize_lizard(self): - """ deserialize ChildLizard, use discriminator - because additional_properties_type is None in ChildLizardAllOf - we are unable to use the discriminator - For this to work correctly, additional_properties_type must allow in any type - Then in ChildLizardAllOf defines the property pet_type and allows in lovesRocks as an additionalProperty - """ - with self.assertRaises(petstore_api.exceptions.ApiValueError): - data = { - "pet_type": "ChildLizard", - "lovesRocks": True - } - response = MockResponse(data=json.dumps(data)) - - lizard = self.deserialize(response, - (parent_pet.ParentPet,), True) - - def test_deserialize_dict_str_int(self): - """ deserialize dict(str, int) """ - data = { - 'integer': 1 - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, ({str: (int,)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['integer'], int)) - - def test_deserialize_str(self): - """ deserialize str """ - data = "test str" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (str,), True) - self.assertTrue(isinstance(deserialized, str)) - - def test_deserialize_date(self): - """ deserialize date """ - data = "1997-07-16" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (datetime.date,), True) - self.assertTrue(isinstance(deserialized, datetime.date)) - - def test_deserialize_datetime(self): - """ deserialize datetime """ - data = "1997-07-16T19:20:30.45+01:00" - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (datetime.datetime,), True) - self.assertTrue(isinstance(deserialized, datetime.datetime)) - - def test_deserialize_pet(self): - """ deserialize pet """ - data = { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (pet.Pet,), True) - self.assertTrue(isinstance(deserialized, pet.Pet)) - self.assertEqual(deserialized.id, 0) - self.assertEqual(deserialized.name, "doggie") - self.assertTrue(isinstance(deserialized.category, category.Category)) - self.assertEqual(deserialized.category.name, "string") - self.assertTrue(isinstance(deserialized.tags, list)) - self.assertEqual(deserialized.tags[0].full_name, "string") - - def test_deserialize_list_of_pet(self): - """ deserialize list[Pet] """ - data = [ - { - "id": 0, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie0", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - }, - { - "id": 1, - "category": { - "id": 0, - "name": "string" - }, - "name": "doggie1", - "photoUrls": [ - "string" - ], - "tags": [ - { - "id": 0, - "fullName": "string" - } - ], - "status": "available" - }] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ([pet.Pet],), True) - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], pet.Pet)) - self.assertEqual(deserialized[0].id, 0) - self.assertEqual(deserialized[1].id, 1) - self.assertEqual(deserialized[0].name, "doggie0") - self.assertEqual(deserialized[1].name, "doggie1") - - def test_deserialize_nested_dict(self): - """ deserialize dict(str, dict(str, int)) """ - data = { - "foo": { - "bar": 1 - } - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, - ({str: ({str: (int,)},)},), True) - self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized["foo"], dict)) - self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) - - def test_deserialize_nested_list(self): - """ deserialize list[list[str]] """ - data = [["foo"]] - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, ([[str]],), True) - self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], list)) - self.assertTrue(isinstance(deserialized[0][0], str)) - - def test_deserialize_none(self): - """ deserialize None """ - response = MockResponse(data=json.dumps(None)) - - error_msg = ( - "Invalid type for variable 'received_data'. Required value type is " - "datetime and passed type was NoneType at ['received_data']" - ) - with self.assertRaises(ApiTypeError) as exc: - deserialized = self.deserialize(response, (datetime.datetime,), True) - self.assertEqual(str(exc.exception), error_msg) - - def test_deserialize_OuterEnum(self): - """ deserialize OuterEnum """ - # make sure that an exception is thrown on an invalid value - with self.assertRaises(ApiValueError): - self.deserialize( - MockResponse(data=json.dumps("test str")), - (string_enum.StringEnum,), - True - ) - - # valid value works - placed_str = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"] - ) - response = MockResponse(data=json.dumps(placed_str)) - deserialized = self.deserialize(response, - (string_enum.StringEnum,), True) - self.assertTrue(isinstance(deserialized, string_enum.StringEnum)) - self.assertTrue(deserialized.value == placed_str) - - def test_deserialize_NumberWithValidations(self): - """ deserialize NumberWithValidations """ - # make sure that an exception is thrown on an invalid type value - with self.assertRaises(ApiTypeError): - deserialized = self.deserialize( - MockResponse(data=json.dumps("test str")), - (number_with_validations.NumberWithValidations,), - True - ) - - # make sure that an exception is thrown on an invalid value - with self.assertRaises(ApiValueError): - deserialized = self.deserialize( - MockResponse(data=json.dumps(21.0)), - (number_with_validations.NumberWithValidations,), - True - ) - - # valid value works - number_val = 11.0 - response = MockResponse(data=json.dumps(number_val)) - number = self.deserialize(response, - (number_with_validations.NumberWithValidations,), True) - self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) - self.assertTrue(number.value == number_val) - - def test_deserialize_file(self): - """Ensures that file deserialization works""" - response_types_mixed = (file_type,) - - # sample from http://www.jtricks.com/download-text - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {'Content-Disposition': 'attachment; filename=content.txt'} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - file_data = ( - "You are reading text file that was supposed to be downloaded\r\n" - "to your hard disk. If your browser offered to save you the file," - "\r\nthen it handled the Content-Disposition header correctly." - ) - http_response = HTTPResponse( - status=200, - reason='OK', - data=file_data, - getheaders=get_headers, - getheader=get_header - ) - # response which is deserialized to a file - mock_response = RESTResponse(http_response) - file_path = None - try: - file_object = self.deserialize( - mock_response, response_types_mixed, True) - self.assertTrue(isinstance(file_object, file_type)) - file_path = file_object.name - self.assertFalse(file_object.closed) - file_object.close() - if six.PY3: - file_data = file_data.encode('utf-8') - with open(file_path, 'rb') as other_file_object: - self.assertEqual(other_file_object.read(), file_data) - finally: - os.unlink(file_path) - - def test_deserialize_binary_to_str(self): - """Ensures that bytes deserialization works""" - response_types_mixed = (str,) - - # sample from http://www.jtricks.com/download-text - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - data = "str" - - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), - getheaders=get_headers, - getheader=get_header - ) - - mock_response = RESTResponse(http_response) - - result = self.deserialize(mock_response, response_types_mixed, True) - self.assertEqual(isinstance(result, str), True) - self.assertEqual(result, data) - - def test_deserialize_string_boolean_map(self): - """ - Ensures that string boolean (additional properties) - deserialization works - """ - # make sure that an exception is thrown on an invalid type - with self.assertRaises(ApiTypeError): - deserialized = self.deserialize( - MockResponse(data=json.dumps("test str")), - (string_boolean_map.StringBooleanMap,), - True - ) - - # valid value works - item_val = {'some_key': True} - response = MockResponse(data=json.dumps(item_val)) - model = string_boolean_map.StringBooleanMap(**item_val) - deserialized = self.deserialize(response, - (string_boolean_map.StringBooleanMap,), True) - self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap)) - self.assertTrue(deserialized['some_key'] == True) - self.assertTrue(deserialized == model) - diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py deleted file mode 100644 index 38d7a1cc0b82..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py +++ /dev/null @@ -1,406 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -from collections import namedtuple -import json -import os -import unittest - -import petstore_api -from petstore_api import Configuration -from petstore_api.rest import ( - RESTClientObject, - RESTResponse -) - -import six - -from petstore_api.exceptions import ( - ApiException, - ApiValueError, - ApiTypeError, -) -from petstore_api.api.pet_api import PetApi -from petstore_api.model import pet -from .util import id_gen - -import urllib3 - -if six.PY3: - from unittest.mock import patch -else: - from mock import patch - -HOST = 'http://localhost/v2' - - -class TimeoutWithEqual(urllib3.Timeout): - def __init__(self, *arg, **kwargs): - super(TimeoutWithEqual, self).__init__(*arg, **kwargs) - - def __eq__(self, other): - return self._read == other._read and self._connect == other._connect and self.total == other.total - - -class MockPoolManager(object): - def __init__(self, tc): - self._tc = tc - self._reqs = [] - - def expect_request(self, *args, **kwargs): - self._reqs.append((args, kwargs)) - - def request(self, *args, **kwargs): - self._tc.assertTrue(len(self._reqs) > 0) - r = self._reqs.pop(0) - self._tc.maxDiff = None - self._tc.assertEqual(r[0], args) - self._tc.assertEqual(r[1], kwargs) - return urllib3.HTTPResponse(status=200, body=b'test') - - -class PetApiTests(unittest.TestCase): - - def setUp(self): - config = Configuration() - config.host = HOST - config.access_token = 'ACCESS_TOKEN' - self.api_client = petstore_api.ApiClient(config) - self.pet_api = PetApi(self.api_client) - self.setUpModels() - self.setUpFiles() - - def setUpModels(self): - from petstore_api.model import category, tag - self.category = category.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = tag.Tag() - self.tag.id = id_gen() - self.tag.name = "python-pet-tag" - self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def setUpFiles(self): - self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") - self.test_file_dir = os.path.realpath(self.test_file_dir) - - def test_preload_content_flag(self): - self.pet_api.add_pet(self.pet) - - resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) - - # return response should at least have read and close methods. - self.assertTrue(hasattr(resp, 'read')) - self.assertTrue(hasattr(resp, 'close')) - - # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. - self.assertTrue(hasattr(resp, 'release_conn')) - - # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking - # change, however supporting above methods should be enough for most usecases. Remove this test case if - # we followed the breaking change procedure for python client (e.g. increasing major version). - self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') - - resp.close() - resp.release_conn() - - def test_config(self): - config = Configuration(host=HOST) - self.assertIsNotNone(config.get_host_settings()) - self.assertEqual(config.get_basic_auth_token(), - urllib3.util.make_headers(basic_auth=":").get('authorization')) - # No authentication scheme has been configured at this point, so auth_settings() - # should return an empty list. - self.assertEqual(len(config.auth_settings()), 0) - # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters. - config.access_token = 'MY-ACCESS_TOKEN' - self.assertEqual(len(config.auth_settings()), 1) - self.assertIn("petstore_auth", config.auth_settings().keys()) - config.username = "user" - config.password = "password" - self.assertEqual( - config.get_basic_auth_token(), - urllib3.util.make_headers(basic_auth="user:password").get('authorization')) - self.assertEqual(len(config.auth_settings()), 2) - self.assertIn("petstore_auth", config.auth_settings().keys()) - self.assertIn("http_basic_test", config.auth_settings().keys()) - config.username = None - config.password = None - self.assertEqual(len(config.auth_settings()), 1) - self.assertIn("petstore_auth", config.auth_settings().keys()) - - def test_timeout(self): - mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ACCESS_TOKEN', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - - self.pet_api.add_pet(self.pet, _request_timeout=5) - self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) - - def test_separate_default_client_instances(self): - pet_api = PetApi() - pet_api2 = PetApi() - self.assertNotEqual(pet_api.api_client, pet_api2.api_client) - - pet_api.api_client.user_agent = 'api client 3' - pet_api2.api_client.user_agent = 'api client 4' - - self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) - - def test_separate_default_config_instances(self): - pet_api = PetApi() - pet_api2 = PetApi() - self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) - - pet_api.api_client.configuration.host = 'somehost' - pet_api2.api_client.configuration.host = 'someotherhost' - self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - - def test_async_request(self): - thread = self.pet_api.add_pet(self.pet, async_req=True) - response = thread.get() - self.assertIsNone(response) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - result = thread.get() - self.assertIsInstance(result, pet.Pet) - - def test_async_with_result(self): - self.pet_api.add_pet(self.pet, async_req=False) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - - response = thread.get() - response2 = thread2.get() - - self.assertEqual(response.id, self.pet.id) - self.assertIsNotNone(response2.id, self.pet.id) - - def test_async_with_http_info(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True, - _return_http_data_only=False) - data, status, headers = thread.get() - - self.assertIsInstance(data, pet.Pet) - self.assertEqual(status, 200) - - def test_async_exception(self): - self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id(-9999999999999, async_req=True) - - exception = None - try: - thread.get() - except ApiException as e: - exception = e - - self.assertIsInstance(exception, ApiException) - self.assertEqual(exception.status, 404) - - def test_add_pet_and_get_pet_by_id(self): - self.pet_api.add_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertIsNotNone(fetched.category) - self.assertEqual(self.pet.category.name, fetched.category.name) - - def test_add_pet_and_get_pet_by_id_with_http_info(self): - self.pet_api.add_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id( - pet_id=self.pet.id, - _return_http_data_only=False - ) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched[0].id) - self.assertIsNotNone(fetched[0].category) - self.assertEqual(self.pet.category.name, fetched[0].category.name) - - def test_update_pet(self): - self.pet.name = "hello kity with updated" - self.pet_api.update_pet(self.pet) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(self.pet.name, fetched.name) - self.assertIsNotNone(fetched.category) - self.assertEqual(fetched.category.name, self.pet.category.name) - - def test_find_pets_by_status(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) - ) - - def test_find_pets_by_tags(self): - self.pet_api.add_pet(self.pet) - - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) - ) - - def test_update_pet_with_form(self): - self.pet_api.add_pet(self.pet) - - name = "hello kity with form updated" - status = "pending" - self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) - - fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(name, fetched.name) - self.assertEqual(status, fetched.status) - - def test_upload_file(self): - # upload file with form parameter - file_path1 = os.path.join(self.test_file_dir, "1px_pic1.png") - file_path2 = os.path.join(self.test_file_dir, "1px_pic2.png") - try: - file = open(file_path1, "rb") - additional_metadata = "special" - self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata=additional_metadata, - file=file - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file.close() - - # upload only one file - try: - file = open(file_path1, "rb") - self.pet_api.upload_file(pet_id=self.pet.id, file=file) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file.close() - - # upload multiple files - HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] - ) - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - try: - file1 = open(file_path1, "rb") - file2 = open(file_path2, "rb") - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.pet_api.upload_file( - pet_id=684696917, files=[file1, file2]) - mock_method.assert_called_with( - 'POST', - 'http://localhost/v2/pet/684696917/uploadImage', - _preload_content=True, - _request_timeout=None, - body=None, - headers={ - 'Accept': 'application/json', - 'Content-Type': 'multipart/form-data', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python', - 'Authorization': 'Bearer ACCESS_TOKEN' - }, - post_params=[ - ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) - ], - query_params=[] - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - file2.close() - - # passing in an array of files to when file only allows one - # raises an exceptions - try: - file = open(file_path1, "rb") - with self.assertRaises(ApiTypeError) as exc: - self.pet_api.upload_file(pet_id=self.pet.id, file=[file]) - finally: - file.close() - - # passing in a single file when an array of file is required - # raises an exception - try: - file = open(file_path1, "rb") - with self.assertRaises(ApiTypeError) as exc: - self.pet_api.upload_file(pet_id=self.pet.id, files=file) - finally: - file.close() - - # passing in a closed file raises an exception - with self.assertRaises(ApiValueError) as exc: - file = open(file_path1, "rb") - file.close() - self.pet_api.upload_file(pet_id=self.pet.id, file=file) - - - def test_delete_pet(self): - self.pet_api.add_pet(self.pet) - self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") - - try: - self.pet_api.get_pet_by_id(pet_id=self.pet.id) - raise Exception("expected an error") - except ApiException as e: - self.assertEqual(404, e.status) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py deleted file mode 100644 index 1f718ecca6b5..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import os -import time -import unittest -import datetime - -import six - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) -from petstore_api.model import ( - enum_test, - pet, - animal, - dog, - parent_pet, - child_lizard, - category, - string_enum, - string_boolean_map, -) -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -from petstore_api.rest import RESTResponse - -MockResponse = namedtuple('MockResponse', 'data') - -class SerializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.serialize = self.api_client.sanitize_for_serialization - - def test_enum_test(self): - """ serialize dict(str, Enum_Test) """ - value = ( - string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) - string_enum_val = string_enum.StringEnum(value) - - source = enum_test.EnumTest( - enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - string_enum=string_enum_val - ) - - result = { - 'enum_test': { - "enum_string": "UPPER", - "enum_string_required": "lower", - "enum_integer": 1, - "enum_number": 1.1, - "stringEnum": "placed" - } - } - serialized = self.serialize({"enum_test": source}) - - self.assertEqual(result, serialized) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py deleted file mode 100644 index a7c1d5dd6670..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAP/Petstore-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi - - -class StoreApiTests(unittest.TestCase): - - def setUp(self): - self.store_api = StoreApi() - - def tearDown(self): - # sleep 1 sec between two every 2 tests - time.sleep(1) - - def test_get_inventory(self): - data = self.store_api.get_inventory() - self.assertIsNotNone(data) - self.assertTrue(isinstance(data, dict)) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py deleted file mode 100644 index 113d7dcc5478..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) diff --git a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini deleted file mode 100644 index 8989fc3c4d96..000000000000 --- a/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/client/petstore/python-tornado/.gitignore b/samples/client/petstore/python-tornado/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/client/petstore/python-tornado/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/client/petstore/python-tornado/.gitlab-ci.yml b/samples/client/petstore/python-tornado/.gitlab-ci.yml deleted file mode 100644 index 142ce3712ed0..000000000000 --- a/samples/client/petstore/python-tornado/.gitlab-ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.nosetest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest - image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest - image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest - image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest - image: python:3.8-alpine diff --git a/samples/client/petstore/python-tornado/.openapi-generator-ignore b/samples/client/petstore/python-tornado/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/python-tornado/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/python-tornado/.openapi-generator/FILES b/samples/client/petstore/python-tornado/.openapi-generator/FILES deleted file mode 100644 index 5835827fb98f..000000000000 --- a/samples/client/petstore/python-tornado/.openapi-generator/FILES +++ /dev/null @@ -1,126 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/models/__init__.py -petstore_api/models/additional_properties_any_type.py -petstore_api/models/additional_properties_array.py -petstore_api/models/additional_properties_boolean.py -petstore_api/models/additional_properties_class.py -petstore_api/models/additional_properties_integer.py -petstore_api/models/additional_properties_number.py -petstore_api/models/additional_properties_object.py -petstore_api/models/additional_properties_string.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/big_cat.py -petstore_api/models/big_cat_all_of.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/format_test.py -petstore_api/models/has_only_read_only.py -petstore_api/models/list.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/number_only.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/pet.py -petstore_api/models/read_only_first.py -petstore_api/models/special_model_name.py -petstore_api/models/tag.py -petstore_api/models/type_holder_default.py -petstore_api/models/type_holder_example.py -petstore_api/models/user.py -petstore_api/models/xml_item.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.travis.yml b/samples/client/petstore/python-tornado/.travis.yml deleted file mode 100644 index fcd7e31c7ccf..000000000000 --- a/samples/client/petstore/python-tornado/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/client/petstore/python-tornado/Makefile b/samples/client/petstore/python-tornado/Makefile deleted file mode 100644 index 1f9d56252268..000000000000 --- a/samples/client/petstore/python-tornado/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test-all: clean - bash ./test_python2_and_3.sh diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md deleted file mode 100644 index 3d5bdd33435c..000000000000 --- a/samples/client/petstore/python-tornado/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen - -## Requirements. - -Python 2.7 and 3.4+ - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -from __future__ import print_function - -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -## Author - - - - diff --git a/samples/client/petstore/python-tornado/dev-requirements.txt b/samples/client/petstore/python-tornado/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/client/petstore/python-tornado/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index 6d5625857d5e..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesAnyType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 934c43272a94..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesArray - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 577b141d4703..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesBoolean - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 3b789c813670..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_string** | **dict[str, str]** | | [optional] -**map_number** | **dict[str, float]** | | [optional] -**map_integer** | **dict[str, int]** | | [optional] -**map_boolean** | **dict[str, bool]** | | [optional] -**map_array_integer** | **dict[str, list[int]]** | | [optional] -**map_array_anytype** | **dict[str, list[object]]** | | [optional] -**map_map_string** | **dict[str, dict[str, str]]** | | [optional] -**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional] -**anytype_1** | **object** | | [optional] -**anytype_2** | **object** | | [optional] -**anytype_3** | **object** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 4a5e49e0b020..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 39a8992fd4a6..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesNumber - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesObject.md deleted file mode 100644 index ec590e3cf96f..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesString.md deleted file mode 100644 index c7cc62130506..000000000000 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesString - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Animal.md b/samples/client/petstore/python-tornado/docs/Animal.md deleted file mode 100644 index 8bc43ab53f33..000000000000 --- a/samples/client/petstore/python-tornado/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md deleted file mode 100644 index 047c4ae6444b..000000000000 --- a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(body) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/ApiResponse.md b/samples/client/petstore/python-tornado/docs/ApiResponse.md deleted file mode 100644 index 81a7d0d85227..000000000000 --- a/samples/client/petstore/python-tornado/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index b53b6cdb8c46..000000000000 --- a/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **list[list[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 6116bc7489fd..000000000000 --- a/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **list[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/ArrayTest.md b/samples/client/petstore/python-tornado/docs/ArrayTest.md deleted file mode 100644 index 81420a3b9bbb..000000000000 --- a/samples/client/petstore/python-tornado/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **list[str]** | | [optional] -**array_array_of_integer** | **list[list[int]]** | | [optional] -**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/BigCat.md b/samples/client/petstore/python-tornado/docs/BigCat.md deleted file mode 100644 index d26809fcff80..000000000000 --- a/samples/client/petstore/python-tornado/docs/BigCat.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/BigCatAllOf.md b/samples/client/petstore/python-tornado/docs/BigCatAllOf.md deleted file mode 100644 index c3c42f41da55..000000000000 --- a/samples/client/petstore/python-tornado/docs/BigCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Capitalization.md b/samples/client/petstore/python-tornado/docs/Capitalization.md deleted file mode 100644 index 1ddeadeb3f46..000000000000 --- a/samples/client/petstore/python-tornado/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Cat.md b/samples/client/petstore/python-tornado/docs/Cat.md deleted file mode 100644 index b3eff72b3095..000000000000 --- a/samples/client/petstore/python-tornado/docs/Cat.md +++ /dev/null @@ -1,11 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/CatAllOf.md b/samples/client/petstore/python-tornado/docs/CatAllOf.md deleted file mode 100644 index 0ff7809a99ac..000000000000 --- a/samples/client/petstore/python-tornado/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Category.md b/samples/client/petstore/python-tornado/docs/Category.md deleted file mode 100644 index 095459c80b65..000000000000 --- a/samples/client/petstore/python-tornado/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/ClassModel.md b/samples/client/petstore/python-tornado/docs/ClassModel.md deleted file mode 100644 index 48ed7cbf2ff0..000000000000 --- a/samples/client/petstore/python-tornado/docs/ClassModel.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Client.md b/samples/client/petstore/python-tornado/docs/Client.md deleted file mode 100644 index c3986008d6c3..000000000000 --- a/samples/client/petstore/python-tornado/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Dog.md b/samples/client/petstore/python-tornado/docs/Dog.md deleted file mode 100644 index 7eeaf5b68515..000000000000 --- a/samples/client/petstore/python-tornado/docs/Dog.md +++ /dev/null @@ -1,11 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/DogAllOf.md b/samples/client/petstore/python-tornado/docs/DogAllOf.md deleted file mode 100644 index 6382bbd80671..000000000000 --- a/samples/client/petstore/python-tornado/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/EnumArrays.md b/samples/client/petstore/python-tornado/docs/EnumArrays.md deleted file mode 100644 index 92de0e955650..000000000000 --- a/samples/client/petstore/python-tornado/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/EnumClass.md b/samples/client/petstore/python-tornado/docs/EnumClass.md deleted file mode 100644 index 64830e3d1dee..000000000000 --- a/samples/client/petstore/python-tornado/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/EnumTest.md b/samples/client/petstore/python-tornado/docs/EnumTest.md deleted file mode 100644 index 1911bfa918cd..000000000000 --- a/samples/client/petstore/python-tornado/docs/EnumTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **str** | | [optional] -**enum_string_required** | **str** | | -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md deleted file mode 100644 index f91b85f16367..000000000000 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ /dev/null @@ -1,943 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | - - -# **create_xml_item** -> create_xml_item(xml_item) - -creates an XmlItem - -this route creates an XmlItem - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body - - try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) - except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize(body=body) - - - -Test serialization of outer boolean types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(body=body) - - - -Test serialization of object with outer number type - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) - - try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_number_serialize** -> float fake_outer_number_serialize(body=body) - - - -Test serialization of outer number types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 3.4 # float | Input number as post body (optional) - - try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_string_serialize** -> str fake_outer_string_serialize(body=body) - - - -Test serialization of outer string types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) - - try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | - - try: - api_instance.test_body_with_file_schema(body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, body) - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - query = 'query_example' # str | -body = petstore_api.User() # User | - - try: - api_instance.test_body_with_query_params(query, body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(body) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) -int32 = 56 # int | None (optional) -int64 = 56 # int | None (optional) -float = 3.4 # float | None (optional) -string = 'string_example' # str | None (optional) -binary = '/path/to/file' # file | None (optional) -date = '2013-10-20' # date | None (optional) -date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) -password = 'password_example' # str | None (optional) -param_callback = 'param_callback_example' # str | None (optional) - - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - -To test enum parameters - -To test enum parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') -enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') -enum_query_integer = 56 # int | Query parameter enum test (double) (optional) -enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') - - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) -boolean_group = True # bool | Boolean in group parameters (optional) -int64_group = 56 # int | Integer in group parameters (optional) - - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(param) - -test inline additionalProperties - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = {'key': 'param_example'} # dict[str, str] | request body - - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) - except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**dict[str, str]**](str.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pipe = ['pipe_example'] # list[str] | -ioutil = ['ioutil_example'] # list[str] | -http = ['http_example'] # list[str] | -url = ['url_example'] # list[str] | -context = ['context_example'] # list[str] | - - try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) - except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**list[str]**](str.md)| | - **ioutil** | [**list[str]**](str.md)| | - **http** | [**list[str]**](str.md)| | - **url** | [**list[str]**](str.md)| | - **context** | [**list[str]**](str.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 66b43fb1ea11..000000000000 --- a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,82 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(body) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - body = petstore_api.Client() # Client | client model - - try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/File.md b/samples/client/petstore/python-tornado/docs/File.md deleted file mode 100644 index 63b1d1a65186..000000000000 --- a/samples/client/petstore/python-tornado/docs/File.md +++ /dev/null @@ -1,12 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/FileSchemaTestClass.md b/samples/client/petstore/python-tornado/docs/FileSchemaTestClass.md deleted file mode 100644 index 58d71b7a26be..000000000000 --- a/samples/client/petstore/python-tornado/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**list[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/FormatTest.md b/samples/client/petstore/python-tornado/docs/FormatTest.md deleted file mode 100644 index 239b60134ab5..000000000000 --- a/samples/client/petstore/python-tornado/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **float** | | -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**byte** | **str** | | -**binary** | **file** | | [optional] -**date** | **date** | | -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**password** | **str** | | -**big_decimal** | [**Decimal**](Decimal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md deleted file mode 100644 index 0e1334519a8b..000000000000 --- a/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/List.md b/samples/client/petstore/python-tornado/docs/List.md deleted file mode 100644 index 4b60956971aa..000000000000 --- a/samples/client/petstore/python-tornado/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/MapTest.md b/samples/client/petstore/python-tornado/docs/MapTest.md deleted file mode 100644 index 8f136137b524..000000000000 --- a/samples/client/petstore/python-tornado/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional] -**map_of_enum_string** | **dict[str, str]** | | [optional] -**direct_map** | **dict[str, bool]** | | [optional] -**indirect_map** | **dict[str, bool]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 46fb6992509c..000000000000 --- a/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**dict[str, Animal]**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Model200Response.md b/samples/client/petstore/python-tornado/docs/Model200Response.md deleted file mode 100644 index c958bd4b33f8..000000000000 --- a/samples/client/petstore/python-tornado/docs/Model200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/ModelReturn.md b/samples/client/petstore/python-tornado/docs/ModelReturn.md deleted file mode 100644 index 043e9d466fab..000000000000 --- a/samples/client/petstore/python-tornado/docs/ModelReturn.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Model_200Response.md b/samples/client/petstore/python-tornado/docs/Model_200Response.md deleted file mode 100644 index 4fd119d12515..000000000000 --- a/samples/client/petstore/python-tornado/docs/Model_200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Model_Return.md b/samples/client/petstore/python-tornado/docs/Model_Return.md deleted file mode 100644 index 674c441551b3..000000000000 --- a/samples/client/petstore/python-tornado/docs/Model_Return.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Name.md b/samples/client/petstore/python-tornado/docs/Name.md deleted file mode 100644 index 3be719cdbfba..000000000000 --- a/samples/client/petstore/python-tornado/docs/Name.md +++ /dev/null @@ -1,15 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/NumberOnly.md b/samples/client/petstore/python-tornado/docs/NumberOnly.md deleted file mode 100644 index 37195c5d8994..000000000000 --- a/samples/client/petstore/python-tornado/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Order.md b/samples/client/petstore/python-tornado/docs/Order.md deleted file mode 100644 index f360fffe8149..000000000000 --- a/samples/client/petstore/python-tornado/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to False] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/OuterComposite.md b/samples/client/petstore/python-tornado/docs/OuterComposite.md deleted file mode 100644 index 31013673df73..000000000000 --- a/samples/client/petstore/python-tornado/docs/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# OuterComposite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/OuterEnum.md b/samples/client/petstore/python-tornado/docs/OuterEnum.md deleted file mode 100644 index 4cb31437c7e2..000000000000 --- a/samples/client/petstore/python-tornado/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/Pet.md b/samples/client/petstore/python-tornado/docs/Pet.md deleted file mode 100644 index c462e794c89a..000000000000 --- a/samples/client/petstore/python-tornado/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **str** | | -**photo_urls** | **list[str]** | | -**tags** | [**list[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md deleted file mode 100644 index e8176632d088..000000000000 --- a/samples/client/petstore/python-tornado/docs/PetApi.md +++ /dev/null @@ -1,681 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(body) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Add a new pet to the store - api_instance.add_pet(body) - except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id, api_key=api_key) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) - - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> list[Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - status = ['status_example'] # list[str] | Status values that need to be considered for filter - - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> list[Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - tags = ['tags_example'] # list[str] | Tags to filter by - - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**list[str]**](str.md)| Tags to filter by | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to return - - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(body) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Update an existing pet - api_instance.update_pet(body) - except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id, name=name, status=status) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) -status = 'status_example' # str | Updated status of the pet (optional) - - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -file = '/path/to/file' # file | file to upload (optional) - - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -required_file = '/path/to/file' # file | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md b/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md deleted file mode 100644 index 53b4c61d8445..000000000000 --- a/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/SpecialModelName.md b/samples/client/petstore/python-tornado/docs/SpecialModelName.md deleted file mode 100644 index 268e1134192d..000000000000 --- a/samples/client/petstore/python-tornado/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md deleted file mode 100644 index 832ed33acca8..000000000000 --- a/samples/client/petstore/python-tornado/docs/StoreApi.md +++ /dev/null @@ -1,268 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 'order_id_example' # str | ID of the order that needs to be deleted - - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> dict[str, int] get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**dict[str, int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 56 # int | ID of pet that needs to be fetched - - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(body) - -Place an order for a pet - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - body = petstore_api.Order() # Order | order placed for purchasing the pet - - try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/Tag.md b/samples/client/petstore/python-tornado/docs/Tag.md deleted file mode 100644 index 4ccac4949afc..000000000000 --- a/samples/client/petstore/python-tornado/docs/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md b/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md deleted file mode 100644 index 13d283006304..000000000000 --- a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# TypeHolderDefault - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | [default to True] -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/TypeHolderExample.md b/samples/client/petstore/python-tornado/docs/TypeHolderExample.md deleted file mode 100644 index f75bdd36f647..000000000000 --- a/samples/client/petstore/python-tornado/docs/TypeHolderExample.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeHolderExample - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_item** | **str** | | -**number_item** | **float** | | -**float_item** | **float** | | -**integer_item** | **int** | | -**bool_item** | **bool** | | -**array_item** | **list[int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/User.md b/samples/client/petstore/python-tornado/docs/User.md deleted file mode 100644 index b0079f591b6e..000000000000 --- a/samples/client/petstore/python-tornado/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md deleted file mode 100644 index 6cb9d1ec3849..000000000000 --- a/samples/client/petstore/python-tornado/docs/UserApi.md +++ /dev/null @@ -1,501 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(body) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = petstore_api.User() # User | Created user object - - try: - # Create user - api_instance.create_user(body) - except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(body) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be deleted - - try: - # Delete user - api_instance.delete_user(username) - except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - - try: - # Logs out current logged in user session - api_instance.logout_user() - except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | name that need to be deleted -body = petstore_api.User() # User | Updated user object - - try: - # Updated user - api_instance.update_user(username, body) - except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/python-tornado/docs/XmlItem.md b/samples/client/petstore/python-tornado/docs/XmlItem.md deleted file mode 100644 index acaadbdb5f78..000000000000 --- a/samples/client/petstore/python-tornado/docs/XmlItem.md +++ /dev/null @@ -1,39 +0,0 @@ -# XmlItem - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attribute_string** | **str** | | [optional] -**attribute_number** | **float** | | [optional] -**attribute_integer** | **int** | | [optional] -**attribute_boolean** | **bool** | | [optional] -**wrapped_array** | **list[int]** | | [optional] -**name_string** | **str** | | [optional] -**name_number** | **float** | | [optional] -**name_integer** | **int** | | [optional] -**name_boolean** | **bool** | | [optional] -**name_array** | **list[int]** | | [optional] -**name_wrapped_array** | **list[int]** | | [optional] -**prefix_string** | **str** | | [optional] -**prefix_number** | **float** | | [optional] -**prefix_integer** | **int** | | [optional] -**prefix_boolean** | **bool** | | [optional] -**prefix_array** | **list[int]** | | [optional] -**prefix_wrapped_array** | **list[int]** | | [optional] -**namespace_string** | **str** | | [optional] -**namespace_number** | **float** | | [optional] -**namespace_integer** | **int** | | [optional] -**namespace_boolean** | **bool** | | [optional] -**namespace_array** | **list[int]** | | [optional] -**namespace_wrapped_array** | **list[int]** | | [optional] -**prefix_ns_string** | **str** | | [optional] -**prefix_ns_number** | **float** | | [optional] -**prefix_ns_integer** | **int** | | [optional] -**prefix_ns_boolean** | **bool** | | [optional] -**prefix_ns_array** | **list[int]** | | [optional] -**prefix_ns_wrapped_array** | **list[int]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python-tornado/git_push.sh b/samples/client/petstore/python-tornado/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/python-tornado/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/python-tornado/petstore_api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/__init__.py deleted file mode 100644 index 62a0d6bb97f5..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/__init__.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - -# import ApiClient -from petstore_api.api_client import ApiClient -from petstore_api.configuration import Configuration -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiException -# import models into sdk package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem - diff --git a/samples/client/petstore/python-tornado/petstore_api/api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/api/__init__.py deleted file mode 100644 index ea4a9e3acb7d..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py deleted file mode 100644 index 8719c9511f17..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def call_123_test_special_tags(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 - - def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method call_123_test_special_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py deleted file mode 100644 index 7eae03dd24ec..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2230 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_xml_item(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 - - def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) - >>> result = thread.get() - - :param xml_item: XmlItem Body (required) - :type xml_item: XmlItem - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'xml_item' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_xml_item" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'xml_item' in local_var_params: - body_params = local_var_params['xml_item'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/create_xml_item', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bool - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_boolean_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "bool", - } - - return self.api_client.call_api( - '/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: OuterComposite - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input composite as post body - :type body: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_composite_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "OuterComposite", - } - - return self.api_client.call_api( - '/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: float - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_number_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "float", - } - - return self.api_client.call_api( - '/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_string_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - } - - return self.api_client.call_api( - '/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_file_schema(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 - - def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: (required) - :type body: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_file_schema" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-file-schema', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 - - def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param body: (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'query', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_query_params" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query' is set - if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query') is not None: # noqa: E501 - query_params.append(('query', local_var_params['query'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-query-params', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 - - def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_client_model" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'number' is set - if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'double' is set - if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 - raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 - raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) > 64): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) < 10): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'integer' in local_var_params: - form_params.append(('integer', local_var_params['integer'])) # noqa: E501 - if 'int32' in local_var_params: - form_params.append(('int32', local_var_params['int32'])) # noqa: E501 - if 'int64' in local_var_params: - form_params.append(('int64', local_var_params['int64'])) # noqa: E501 - if 'number' in local_var_params: - form_params.append(('number', local_var_params['number'])) # noqa: E501 - if 'float' in local_var_params: - form_params.append(('float', local_var_params['float'])) # noqa: E501 - if 'double' in local_var_params: - form_params.append(('double', local_var_params['double'])) # noqa: E501 - if 'string' in local_var_params: - form_params.append(('string', local_var_params['string'])) # noqa: E501 - if 'pattern_without_delimiter' in local_var_params: - form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 - if 'byte' in local_var_params: - form_params.append(('byte', local_var_params['byte'])) # noqa: E501 - if 'binary' in local_var_params: - local_var_files['binary'] = local_var_params['binary'] # noqa: E501 - if 'date' in local_var_params: - form_params.append(('date', local_var_params['date'])) # noqa: E501 - if 'date_time' in local_var_params: - form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 - if 'password' in local_var_params: - form_params.append(('password', local_var_params['password'])) # noqa: E501 - if 'param_callback' in local_var_params: - form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_basic_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - - def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters_with_http_info(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_enum_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 - query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 - collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if local_var_params.get('enum_query_string') is not None: # noqa: E501 - query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if local_var_params.get('enum_query_integer') is not None: # noqa: E501 - query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if local_var_params.get('enum_query_double') is not None: # noqa: E501 - query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'enum_header_string_array' in local_var_params: - header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 - collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 - if 'enum_header_string' in local_var_params: - header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 - - form_params = [] - local_var_files = {} - if 'enum_form_string_array' in local_var_params: - form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 - collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 - if 'enum_form_string' in local_var_params: - form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - - def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_group_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('required_string_group') is not None: # noqa: E501 - query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if local_var_params.get('required_int64_group') is not None: # noqa: E501 - query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if local_var_params.get('string_group') is not None: # noqa: E501 - query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if local_var_params.get('int64_group') is not None: # noqa: E501 - query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'required_boolean_group' in local_var_params: - header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 - if 'boolean_group' in local_var_params: - header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 - - def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) - >>> result = thread.get() - - :param param: request body (required) - :type param: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_inline_additional_properties" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'param' in local_var_params: - body_params = local_var_params['param'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - - def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param', - 'param2' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_json_form_data" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 - # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'param' in local_var_params: - form_params.append(('param', local_var_params['param'])) # noqa: E501 - if 'param2' in local_var_params: - form_params.append(('param2', local_var_params['param2'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 - - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_query_parameter_collection_format" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'http' is set - if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'url' is set - if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'context' is set - if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('pipe') is not None: # noqa: E501 - query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 - collection_formats['pipe'] = 'csv' # noqa: E501 - if local_var_params.get('ioutil') is not None: # noqa: E501 - query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 - collection_formats['ioutil'] = 'csv' # noqa: E501 - if local_var_params.get('http') is not None: # noqa: E501 - query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 - if local_var_params.get('url') is not None: # noqa: E501 - query_params.append(('url', local_var_params['url'])) # noqa: E501 - collection_formats['url'] = 'csv' # noqa: E501 - if local_var_params.get('context') is not None: # noqa: E501 - query_params.append(('context', local_var_params['context'])) # noqa: E501 - collection_formats['context'] = 'multi' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/test-query-parameters', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index 7dd05dd2d3dc..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index b5cd8cd22c94..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: client model (required) - :type body: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py deleted file mode 100644 index b2cf9e3641cd..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1332 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_pet(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 - - def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - - def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'api_key' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - if 'api_key' in local_var_params: - header_params['api_key'] = local_var_params['api_key'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - - def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_status" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('status') is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 - collection_formats['status'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - - def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'tags' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('tags') is not None: # noqa: E501 - query_params.append(('tags', local_var_params['tags'])) # noqa: E501 - collection_formats['tags'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Pet - """ - kwargs['_return_http_data_only'] = True - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "Pet", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 - - def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Pet object that needs to be added to the store (required) - :type body: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'name', - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet_with_form" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'name' in local_var_params: - form_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'status' in local_var_params: - form_params.append(('status', local_var_params['status'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 - - def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'additional_metadata', - 'file' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - - def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'required_file', - 'additional_metadata' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file_with_required_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 - # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'required_file' in local_var_params: - local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/fake/{petId}/uploadImageWithRequiredFile', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py deleted file mode 100644 index 17b8b851cfce..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py +++ /dev/null @@ -1,574 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - - def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: dict[str, int] - """ - kwargs['_return_http_data_only'] = True - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 - - def get_inventory_with_http_info(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_inventory" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "dict[str, int]", - } - - return self.api_client.call_api( - '/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - - def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_order_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def place_order(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.place_order_with_http_info(body, **kwargs) # noqa: E501 - - def place_order_with_http_info(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: order placed for purchasing the pet (required) - :type body: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - } - - return self.api_client.call_api( - '/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py deleted file mode 100644 index 29e66939d737..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py +++ /dev/null @@ -1,1100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_user(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_user_with_http_info(body, **kwargs) # noqa: E501 - - def create_user_with_http_info(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: Created user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_array_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_array_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_list_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 - - def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: List of user object (required) - :type body: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_list_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - - def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - - def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "User", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - - def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user_with_http_info(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'password' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 - # verify the required parameter 'password' is set - if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('username') is not None: # noqa: E501 - query_params.append(('username', local_var_params['username'])) # noqa: E501 - if local_var_params.get('password') is not None: # noqa: E501 - query_params.append(('password', local_var_params['password'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - 400: None, - } - - return self.api_client.call_api( - '/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.logout_user_with_http_info(**kwargs) # noqa: E501 - - def logout_user_with_http_info(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_user(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 - - def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_with_http_info(username, body, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param body: Updated user object (required) - :type body: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py deleted file mode 100644 index cd19b46dc885..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ /dev/null @@ -1,703 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote -import tornado.gen - -from petstore_api.configuration import Configuration -import petstore_api.models -from petstore_api import rest -from petstore_api.exceptions import ApiValueError, ApiException - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - @tornado.gen.coroutine - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = yield self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - raise tornado.gen.Return(return_data) - - response_type = response_types_map.get(response_data.status, None) - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict['): - sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(petstore_api.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, queries, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) - - def _apply_auth_params(self, headers, queries, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - kwargs["local_vars_configuration"] = self.configuration - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py deleted file mode 100644 index 4f00d6d3c79a..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ /dev/null @@ -1,522 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -import six -from six.moves import http_client as httplib -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.access_token = None - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://petstore.swagger.io:80/v2", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/client/petstore/python-tornado/petstore_api/exceptions.py b/samples/client/petstore/python-tornado/petstore_api/exceptions.py deleted file mode 100644 index 08181d4775db..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/exceptions.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/client/petstore/python-tornado/petstore_api/models/__init__.py b/samples/client/petstore/python-tornado/petstore_api/models/__init__.py deleted file mode 100644 index ddef3dea4fdb..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.big_cat import BigCat -from petstore_api.models.big_cat_all_of import BigCatAllOf -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_any_type.py deleted file mode 100644 index 01457faa3a33..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_any_type.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesAnyType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesAnyType. # noqa: E501 - - - :return: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesAnyType. - - - :param name: The name of this AdditionalPropertiesAnyType. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesAnyType): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_array.py deleted file mode 100644 index c7283e161360..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_array.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesArray(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesArray. # noqa: E501 - - - :return: The name of this AdditionalPropertiesArray. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesArray. - - - :param name: The name of this AdditionalPropertiesArray. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesArray): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesArray): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_boolean.py deleted file mode 100644 index 3a8ec8f66aac..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_boolean.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesBoolean(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesBoolean. # noqa: E501 - - - :return: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesBoolean. - - - :param name: The name of this AdditionalPropertiesBoolean. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesBoolean): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py deleted file mode 100644 index b561f467d21e..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py +++ /dev/null @@ -1,391 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_string': 'dict[str, str]', - 'map_number': 'dict[str, float]', - 'map_integer': 'dict[str, int]', - 'map_boolean': 'dict[str, bool]', - 'map_array_integer': 'dict[str, list[int]]', - 'map_array_anytype': 'dict[str, list[object]]', - 'map_map_string': 'dict[str, dict[str, str]]', - 'map_map_anytype': 'dict[str, dict[str, object]]', - 'anytype_1': 'object', - 'anytype_2': 'object', - 'anytype_3': 'object' - } - - attribute_map = { - 'map_string': 'map_string', - 'map_number': 'map_number', - 'map_integer': 'map_integer', - 'map_boolean': 'map_boolean', - 'map_array_integer': 'map_array_integer', - 'map_array_anytype': 'map_array_anytype', - 'map_map_string': 'map_map_string', - 'map_map_anytype': 'map_map_anytype', - 'anytype_1': 'anytype_1', - 'anytype_2': 'anytype_2', - 'anytype_3': 'anytype_3' - } - - def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_string = None - self._map_number = None - self._map_integer = None - self._map_boolean = None - self._map_array_integer = None - self._map_array_anytype = None - self._map_map_string = None - self._map_map_anytype = None - self._anytype_1 = None - self._anytype_2 = None - self._anytype_3 = None - self.discriminator = None - - if map_string is not None: - self.map_string = map_string - if map_number is not None: - self.map_number = map_number - if map_integer is not None: - self.map_integer = map_integer - if map_boolean is not None: - self.map_boolean = map_boolean - if map_array_integer is not None: - self.map_array_integer = map_array_integer - if map_array_anytype is not None: - self.map_array_anytype = map_array_anytype - if map_map_string is not None: - self.map_map_string = map_map_string - if map_map_anytype is not None: - self.map_map_anytype = map_map_anytype - if anytype_1 is not None: - self.anytype_1 = anytype_1 - if anytype_2 is not None: - self.anytype_2 = anytype_2 - if anytype_3 is not None: - self.anytype_3 = anytype_3 - - @property - def map_string(self): - """Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_string - - @map_string.setter - def map_string(self, map_string): - """Sets the map_string of this AdditionalPropertiesClass. - - - :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_string: dict[str, str] - """ - - self._map_string = map_string - - @property - def map_number(self): - """Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, float] - """ - return self._map_number - - @map_number.setter - def map_number(self, map_number): - """Sets the map_number of this AdditionalPropertiesClass. - - - :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 - :type map_number: dict[str, float] - """ - - self._map_number = map_number - - @property - def map_integer(self): - """Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, int] - """ - return self._map_integer - - @map_integer.setter - def map_integer(self, map_integer): - """Sets the map_integer of this AdditionalPropertiesClass. - - - :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_integer: dict[str, int] - """ - - self._map_integer = map_integer - - @property - def map_boolean(self): - """Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._map_boolean - - @map_boolean.setter - def map_boolean(self, map_boolean): - """Sets the map_boolean of this AdditionalPropertiesClass. - - - :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 - :type map_boolean: dict[str, bool] - """ - - self._map_boolean = map_boolean - - @property - def map_array_integer(self): - """Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[int]] - """ - return self._map_array_integer - - @map_array_integer.setter - def map_array_integer(self, map_array_integer): - """Sets the map_array_integer of this AdditionalPropertiesClass. - - - :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_integer: dict[str, list[int]] - """ - - self._map_array_integer = map_array_integer - - @property - def map_array_anytype(self): - """Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, list[object]] - """ - return self._map_array_anytype - - @map_array_anytype.setter - def map_array_anytype(self, map_array_anytype): - """Sets the map_array_anytype of this AdditionalPropertiesClass. - - - :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_array_anytype: dict[str, list[object]] - """ - - self._map_array_anytype = map_array_anytype - - @property - def map_map_string(self): - """Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_string - - @map_map_string.setter - def map_map_string(self, map_map_string): - """Sets the map_map_string of this AdditionalPropertiesClass. - - - :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_string: dict[str, dict[str, str]] - """ - - self._map_map_string = map_map_string - - @property - def map_map_anytype(self): - """Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, object]] - """ - return self._map_map_anytype - - @map_map_anytype.setter - def map_map_anytype(self, map_map_anytype): - """Sets the map_map_anytype of this AdditionalPropertiesClass. - - - :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 - :type map_map_anytype: dict[str, dict[str, object]] - """ - - self._map_map_anytype = map_map_anytype - - @property - def anytype_1(self): - """Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_1 - - @anytype_1.setter - def anytype_1(self, anytype_1): - """Sets the anytype_1 of this AdditionalPropertiesClass. - - - :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_1: object - """ - - self._anytype_1 = anytype_1 - - @property - def anytype_2(self): - """Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_2 - - @anytype_2.setter - def anytype_2(self, anytype_2): - """Sets the anytype_2 of this AdditionalPropertiesClass. - - - :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_2: object - """ - - self._anytype_2 = anytype_2 - - @property - def anytype_3(self): - """Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :rtype: object - """ - return self._anytype_3 - - @anytype_3.setter - def anytype_3(self, anytype_3): - """Sets the anytype_3 of this AdditionalPropertiesClass. - - - :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 - :type anytype_3: object - """ - - self._anytype_3 = anytype_3 - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_integer.py deleted file mode 100644 index d9ee889d7a33..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_integer.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesInteger(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesInteger. # noqa: E501 - - - :return: The name of this AdditionalPropertiesInteger. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesInteger. - - - :param name: The name of this AdditionalPropertiesInteger. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesInteger): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_number.py deleted file mode 100644 index 756fc037970f..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_number.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesNumber(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesNumber. # noqa: E501 - - - :return: The name of this AdditionalPropertiesNumber. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesNumber. - - - :param name: The name of this AdditionalPropertiesNumber. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesNumber): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_object.py deleted file mode 100644 index bfbe2db1bef9..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_object.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesObject. # noqa: E501 - - - :return: The name of this AdditionalPropertiesObject. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesObject. - - - :param name: The name of this AdditionalPropertiesObject. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesObject): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesObject): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_string.py deleted file mode 100644 index 7c33a16fe8fc..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_string.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesString(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AdditionalPropertiesString. # noqa: E501 - - - :return: The name of this AdditionalPropertiesString. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AdditionalPropertiesString. - - - :param name: The name of this AdditionalPropertiesString. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesString): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesString): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py deleted file mode 100644 index 335eb2625af4..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Animal(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'class_name': 'str', - 'color': 'str' - } - - attribute_map = { - 'class_name': 'className', - 'color': 'color' - } - - discriminator_value_class_map = { - 'BigCat': 'BigCat', - 'Cat': 'Cat', - 'Dog': 'Dog' - } - - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 - """Animal - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._class_name = None - self._color = None - self.discriminator = 'class_name' - - self.class_name = class_name - if color is not None: - self.color = color - - @property - def class_name(self): - """Gets the class_name of this Animal. # noqa: E501 - - - :return: The class_name of this Animal. # noqa: E501 - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """Sets the class_name of this Animal. - - - :param class_name: The class_name of this Animal. # noqa: E501 - :type class_name: str - """ - if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 - raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 - - self._class_name = class_name - - @property - def color(self): - """Gets the color of this Animal. # noqa: E501 - - - :return: The color of this Animal. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this Animal. - - - :param color: The color of this Animal. # noqa: E501 - :type color: str - """ - - self._color = color - - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Animal): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Animal): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py deleted file mode 100644 index bddac1eb10a3..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ApiResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str' - } - - attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } - - def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._type = None - self._message = None - self.discriminator = None - - if code is not None: - self.code = code - if type is not None: - self.type = type - if message is not None: - self.message = message - - @property - def code(self): - """Gets the code of this ApiResponse. # noqa: E501 - - - :return: The code of this ApiResponse. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this ApiResponse. - - - :param code: The code of this ApiResponse. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def type(self): - """Gets the type of this ApiResponse. # noqa: E501 - - - :return: The type of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this ApiResponse. - - - :param type: The type of this ApiResponse. # noqa: E501 - :type type: str - """ - - self._type = type - - @property - def message(self): - """Gets the message of this ApiResponse. # noqa: E501 - - - :return: The message of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this ApiResponse. - - - :param message: The message of this ApiResponse. # noqa: E501 - :type message: str - """ - - self._message = message - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ApiResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ApiResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py deleted file mode 100644 index 2975adc20e31..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_array_number': 'list[list[float]]' - } - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber' - } - - def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_array_number = None - self.discriminator = None - - if array_array_number is not None: - self.array_array_number = array_array_number - - @property - def array_array_number(self): - """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - - - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :rtype: list[list[float]] - """ - return self._array_array_number - - @array_array_number.setter - def array_array_number(self, array_array_number): - """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. - - - :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :type array_array_number: list[list[float]] - """ - - self._array_array_number = array_array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py deleted file mode 100644 index 2a3400e76660..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_number': 'list[float]' - } - - attribute_map = { - 'array_number': 'ArrayNumber' - } - - def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_number = None - self.discriminator = None - - if array_number is not None: - self.array_number = array_number - - @property - def array_number(self): - """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - - - :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :rtype: list[float] - """ - return self._array_number - - @array_number.setter - def array_number(self, array_number): - """Sets the array_number of this ArrayOfNumberOnly. - - - :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :type array_number: list[float] - """ - - self._array_number = array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py deleted file mode 100644 index 11394dcb7bc1..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' - } - - attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' - } - - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_of_string = None - self._array_array_of_integer = None - self._array_array_of_model = None - self.discriminator = None - - if array_of_string is not None: - self.array_of_string = array_of_string - if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer - if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model - - @property - def array_of_string(self): - """Gets the array_of_string of this ArrayTest. # noqa: E501 - - - :return: The array_of_string of this ArrayTest. # noqa: E501 - :rtype: list[str] - """ - return self._array_of_string - - @array_of_string.setter - def array_of_string(self, array_of_string): - """Sets the array_of_string of this ArrayTest. - - - :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 - :type array_of_string: list[str] - """ - - self._array_of_string = array_of_string - - @property - def array_array_of_integer(self): - """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_integer of this ArrayTest. # noqa: E501 - :rtype: list[list[int]] - """ - return self._array_array_of_integer - - @array_array_of_integer.setter - def array_array_of_integer(self, array_array_of_integer): - """Sets the array_array_of_integer of this ArrayTest. - - - :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 - :type array_array_of_integer: list[list[int]] - """ - - self._array_array_of_integer = array_array_of_integer - - @property - def array_array_of_model(self): - """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_model of this ArrayTest. # noqa: E501 - :rtype: list[list[ReadOnlyFirst]] - """ - return self._array_array_of_model - - @array_array_of_model.setter - def array_array_of_model(self, array_array_of_model): - """Sets the array_array_of_model of this ArrayTest. - - - :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 - :type array_array_of_model: list[list[ReadOnlyFirst]] - """ - - self._array_array_of_model = array_array_of_model - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/big_cat.py b/samples/client/petstore/python-tornado/petstore_api/models/big_cat.py deleted file mode 100644 index 9a108ce3717e..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/big_cat.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCat. # noqa: E501 - - - :return: The kind of this BigCat. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCat. - - - :param kind: The kind of this BigCat. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/big_cat_all_of.py b/samples/client/petstore/python-tornado/petstore_api/models/big_cat_all_of.py deleted file mode 100644 index 6d6c9aeb5c0c..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/big_cat_all_of.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class BigCatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """BigCatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this BigCatAllOf. # noqa: E501 - - - :return: The kind of this BigCatAllOf. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this BigCatAllOf. - - - :param kind: The kind of this BigCatAllOf. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigCatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BigCatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py deleted file mode 100644 index cb8b0d985842..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Capitalization(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str' - } - - attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' - } - - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._small_camel = None - self._capital_camel = None - self._small_snake = None - self._capital_snake = None - self._sca_eth_flow_points = None - self._att_name = None - self.discriminator = None - - if small_camel is not None: - self.small_camel = small_camel - if capital_camel is not None: - self.capital_camel = capital_camel - if small_snake is not None: - self.small_snake = small_snake - if capital_snake is not None: - self.capital_snake = capital_snake - if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points - if att_name is not None: - self.att_name = att_name - - @property - def small_camel(self): - """Gets the small_camel of this Capitalization. # noqa: E501 - - - :return: The small_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_camel - - @small_camel.setter - def small_camel(self, small_camel): - """Sets the small_camel of this Capitalization. - - - :param small_camel: The small_camel of this Capitalization. # noqa: E501 - :type small_camel: str - """ - - self._small_camel = small_camel - - @property - def capital_camel(self): - """Gets the capital_camel of this Capitalization. # noqa: E501 - - - :return: The capital_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_camel - - @capital_camel.setter - def capital_camel(self, capital_camel): - """Sets the capital_camel of this Capitalization. - - - :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 - :type capital_camel: str - """ - - self._capital_camel = capital_camel - - @property - def small_snake(self): - """Gets the small_snake of this Capitalization. # noqa: E501 - - - :return: The small_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_snake - - @small_snake.setter - def small_snake(self, small_snake): - """Sets the small_snake of this Capitalization. - - - :param small_snake: The small_snake of this Capitalization. # noqa: E501 - :type small_snake: str - """ - - self._small_snake = small_snake - - @property - def capital_snake(self): - """Gets the capital_snake of this Capitalization. # noqa: E501 - - - :return: The capital_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_snake - - @capital_snake.setter - def capital_snake(self, capital_snake): - """Sets the capital_snake of this Capitalization. - - - :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 - :type capital_snake: str - """ - - self._capital_snake = capital_snake - - @property - def sca_eth_flow_points(self): - """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - - - :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._sca_eth_flow_points - - @sca_eth_flow_points.setter - def sca_eth_flow_points(self, sca_eth_flow_points): - """Sets the sca_eth_flow_points of this Capitalization. - - - :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :type sca_eth_flow_points: str - """ - - self._sca_eth_flow_points = sca_eth_flow_points - - @property - def att_name(self): - """Gets the att_name of this Capitalization. # noqa: E501 - - Name of the pet # noqa: E501 - - :return: The att_name of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._att_name - - @att_name.setter - def att_name(self, att_name): - """Sets the att_name of this Capitalization. - - Name of the pet # noqa: E501 - - :param att_name: The att_name of this Capitalization. # noqa: E501 - :type att_name: str - """ - - self._att_name = att_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Capitalization): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Capitalization): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/cat.py b/samples/client/petstore/python-tornado/petstore_api/models/cat.py deleted file mode 100644 index 0d9a0b20bf1a..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/cat.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Cat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """Cat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this Cat. # noqa: E501 - - - :return: The declawed of this Cat. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this Cat. - - - :param declawed: The declawed of this Cat. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Cat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Cat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-tornado/petstore_api/models/cat_all_of.py deleted file mode 100644 index 0633bbf58d0d..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/cat_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class CatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this CatAllOf. # noqa: E501 - - - :return: The declawed of this CatAllOf. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this CatAllOf. - - - :param declawed: The declawed of this CatAllOf. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py deleted file mode 100644 index ef52dcbf8c91..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/category.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Category(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 - """Category - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - - @property - def id(self): - """Gets the id of this Category. # noqa: E501 - - - :return: The id of this Category. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Category. - - - :param id: The id of this Category. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Category. # noqa: E501 - - - :return: The name of this Category. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Category. - - - :param name: The name of this Category. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Category): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Category): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py deleted file mode 100644 index 84c0de65b472..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ClassModel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_class': 'str' - } - - attribute_map = { - '_class': '_class' - } - - def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__class = None - self.discriminator = None - - if _class is not None: - self._class = _class - - @property - def _class(self): - """Gets the _class of this ClassModel. # noqa: E501 - - - :return: The _class of this ClassModel. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this ClassModel. - - - :param _class: The _class of this ClassModel. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ClassModel): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ClassModel): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/client.py b/samples/client/petstore/python-tornado/petstore_api/models/client.py deleted file mode 100644 index 8d7c83ecfe6b..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/client.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Client(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'client': 'str' - } - - attribute_map = { - 'client': 'client' - } - - def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 - """Client - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._client = None - self.discriminator = None - - if client is not None: - self.client = client - - @property - def client(self): - """Gets the client of this Client. # noqa: E501 - - - :return: The client of this Client. # noqa: E501 - :rtype: str - """ - return self._client - - @client.setter - def client(self, client): - """Sets the client of this Client. - - - :param client: The client of this Client. # noqa: E501 - :type client: str - """ - - self._client = client - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Client): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Client): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/dog.py b/samples/client/petstore/python-tornado/petstore_api/models/dog.py deleted file mode 100644 index 61acd35cdfe2..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/dog.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Dog(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """Dog - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this Dog. # noqa: E501 - - - :return: The breed of this Dog. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this Dog. - - - :param breed: The breed of this Dog. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dog): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Dog): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-tornado/petstore_api/models/dog_all_of.py deleted file mode 100644 index 3a052c3258ae..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/dog_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class DogAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this DogAllOf. # noqa: E501 - - - :return: The breed of this DogAllOf. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this DogAllOf. - - - :param breed: The breed of this DogAllOf. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DogAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DogAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py deleted file mode 100644 index eb4f3ea4ca32..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumArrays(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]' - } - - attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' - } - - def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_symbol = None - self._array_enum = None - self.discriminator = None - - if just_symbol is not None: - self.just_symbol = just_symbol - if array_enum is not None: - self.array_enum = array_enum - - @property - def just_symbol(self): - """Gets the just_symbol of this EnumArrays. # noqa: E501 - - - :return: The just_symbol of this EnumArrays. # noqa: E501 - :rtype: str - """ - return self._just_symbol - - @just_symbol.setter - def just_symbol(self, just_symbol): - """Sets the just_symbol of this EnumArrays. - - - :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 - :type just_symbol: str - """ - allowed_values = [">=", "$"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 - .format(just_symbol, allowed_values) - ) - - self._just_symbol = just_symbol - - @property - def array_enum(self): - """Gets the array_enum of this EnumArrays. # noqa: E501 - - - :return: The array_enum of this EnumArrays. # noqa: E501 - :rtype: list[str] - """ - return self._array_enum - - @array_enum.setter - def array_enum(self, array_enum): - """Sets the array_enum of this EnumArrays. - - - :param array_enum: The array_enum of this EnumArrays. # noqa: E501 - :type array_enum: list[str] - """ - allowed_values = ["fish", "crab"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(array_enum).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._array_enum = array_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumArrays): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumArrays): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py deleted file mode 100644 index 79aac3570cb9..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _ABC = "_abc" - _EFG = "-efg" - _XYZ_ = "(xyz)" - - allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """EnumClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py deleted file mode 100644 index 1f3d7cb29b89..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py +++ /dev/null @@ -1,260 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'enum_string': 'str', - 'enum_string_required': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum' - } - - attribute_map = { - 'enum_string': 'enum_string', - 'enum_string_required': 'enum_string_required', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum' - } - - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._enum_string = None - self._enum_string_required = None - self._enum_integer = None - self._enum_number = None - self._outer_enum = None - self.discriminator = None - - if enum_string is not None: - self.enum_string = enum_string - self.enum_string_required = enum_string_required - if enum_integer is not None: - self.enum_integer = enum_integer - if enum_number is not None: - self.enum_number = enum_number - if outer_enum is not None: - self.outer_enum = outer_enum - - @property - def enum_string(self): - """Gets the enum_string of this EnumTest. # noqa: E501 - - - :return: The enum_string of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string - - @enum_string.setter - def enum_string(self, enum_string): - """Sets the enum_string of this EnumTest. - - - :param enum_string: The enum_string of this EnumTest. # noqa: E501 - :type enum_string: str - """ - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string, allowed_values) - ) - - self._enum_string = enum_string - - @property - def enum_string_required(self): - """Gets the enum_string_required of this EnumTest. # noqa: E501 - - - :return: The enum_string_required of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string_required - - @enum_string_required.setter - def enum_string_required(self, enum_string_required): - """Sets the enum_string_required of this EnumTest. - - - :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 - :type enum_string_required: str - """ - if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 - raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string_required, allowed_values) - ) - - self._enum_string_required = enum_string_required - - @property - def enum_integer(self): - """Gets the enum_integer of this EnumTest. # noqa: E501 - - - :return: The enum_integer of this EnumTest. # noqa: E501 - :rtype: int - """ - return self._enum_integer - - @enum_integer.setter - def enum_integer(self, enum_integer): - """Sets the enum_integer of this EnumTest. - - - :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 - :type enum_integer: int - """ - allowed_values = [1, -1] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 - .format(enum_integer, allowed_values) - ) - - self._enum_integer = enum_integer - - @property - def enum_number(self): - """Gets the enum_number of this EnumTest. # noqa: E501 - - - :return: The enum_number of this EnumTest. # noqa: E501 - :rtype: float - """ - return self._enum_number - - @enum_number.setter - def enum_number(self, enum_number): - """Sets the enum_number of this EnumTest. - - - :param enum_number: The enum_number of this EnumTest. # noqa: E501 - :type enum_number: float - """ - allowed_values = [1.1, -1.2] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 - .format(enum_number, allowed_values) - ) - - self._enum_number = enum_number - - @property - def outer_enum(self): - """Gets the outer_enum of this EnumTest. # noqa: E501 - - - :return: The outer_enum of this EnumTest. # noqa: E501 - :rtype: OuterEnum - """ - return self._outer_enum - - @outer_enum.setter - def outer_enum(self, outer_enum): - """Sets the outer_enum of this EnumTest. - - - :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 - :type outer_enum: OuterEnum - """ - - self._outer_enum = outer_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/file.py b/samples/client/petstore/python-tornado/petstore_api/models/file.py deleted file mode 100644 index 2c1cccac0e11..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/file.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class File(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'source_uri': 'str' - } - - attribute_map = { - 'source_uri': 'sourceURI' - } - - def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 - """File - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._source_uri = None - self.discriminator = None - - if source_uri is not None: - self.source_uri = source_uri - - @property - def source_uri(self): - """Gets the source_uri of this File. # noqa: E501 - - Test capitalization # noqa: E501 - - :return: The source_uri of this File. # noqa: E501 - :rtype: str - """ - return self._source_uri - - @source_uri.setter - def source_uri(self, source_uri): - """Sets the source_uri of this File. - - Test capitalization # noqa: E501 - - :param source_uri: The source_uri of this File. # noqa: E501 - :type source_uri: str - """ - - self._source_uri = source_uri - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, File): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, File): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-tornado/petstore_api/models/file_schema_test_class.py deleted file mode 100644 index c5a23842d4f6..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/file_schema_test_class.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FileSchemaTestClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'file': 'File', - 'files': 'list[File]' - } - - attribute_map = { - 'file': 'file', - 'files': 'files' - } - - def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._file = None - self._files = None - self.discriminator = None - - if file is not None: - self.file = file - if files is not None: - self.files = files - - @property - def file(self): - """Gets the file of this FileSchemaTestClass. # noqa: E501 - - - :return: The file of this FileSchemaTestClass. # noqa: E501 - :rtype: File - """ - return self._file - - @file.setter - def file(self, file): - """Sets the file of this FileSchemaTestClass. - - - :param file: The file of this FileSchemaTestClass. # noqa: E501 - :type file: File - """ - - self._file = file - - @property - def files(self): - """Gets the files of this FileSchemaTestClass. # noqa: E501 - - - :return: The files of this FileSchemaTestClass. # noqa: E501 - :rtype: list[File] - """ - return self._files - - @files.setter - def files(self, files): - """Sets the files of this FileSchemaTestClass. - - - :param files: The files of this FileSchemaTestClass. # noqa: E501 - :type files: list[File] - """ - - self._files = files - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FileSchemaTestClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FileSchemaTestClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py deleted file mode 100644 index 452582251a59..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py +++ /dev/null @@ -1,515 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FormatTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'byte': 'str', - 'binary': 'file', - 'date': 'date', - 'date_time': 'datetime', - 'uuid': 'str', - 'password': 'str', - 'big_decimal': 'Decimal' - } - - attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password', - 'big_decimal': 'BigDecimal' - } - - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None, local_vars_configuration=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer = None - self._int32 = None - self._int64 = None - self._number = None - self._float = None - self._double = None - self._string = None - self._byte = None - self._binary = None - self._date = None - self._date_time = None - self._uuid = None - self._password = None - self._big_decimal = None - self.discriminator = None - - if integer is not None: - self.integer = integer - if int32 is not None: - self.int32 = int32 - if int64 is not None: - self.int64 = int64 - self.number = number - if float is not None: - self.float = float - if double is not None: - self.double = double - if string is not None: - self.string = string - self.byte = byte - if binary is not None: - self.binary = binary - self.date = date - if date_time is not None: - self.date_time = date_time - if uuid is not None: - self.uuid = uuid - self.password = password - if big_decimal is not None: - self.big_decimal = big_decimal - - @property - def integer(self): - """Gets the integer of this FormatTest. # noqa: E501 - - - :return: The integer of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this FormatTest. - - - :param integer: The integer of this FormatTest. # noqa: E501 - :type integer: int - """ - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer > 100): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer < 10): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - - self._integer = integer - - @property - def int32(self): - """Gets the int32 of this FormatTest. # noqa: E501 - - - :return: The int32 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int32 - - @int32.setter - def int32(self, int32): - """Sets the int32 of this FormatTest. - - - :param int32: The int32 of this FormatTest. # noqa: E501 - :type int32: int - """ - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 > 200): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 < 20): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - - self._int32 = int32 - - @property - def int64(self): - """Gets the int64 of this FormatTest. # noqa: E501 - - - :return: The int64 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int64 - - @int64.setter - def int64(self, int64): - """Sets the int64 of this FormatTest. - - - :param int64: The int64 of this FormatTest. # noqa: E501 - :type int64: int - """ - - self._int64 = int64 - - @property - def number(self): - """Gets the number of this FormatTest. # noqa: E501 - - - :return: The number of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this FormatTest. - - - :param number: The number of this FormatTest. # noqa: E501 - :type number: float - """ - if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number > 543.2): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number < 32.1): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - - self._number = number - - @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 - - - :return: The float of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._float - - @float.setter - def float(self, float): - """Sets the float of this FormatTest. - - - :param float: The float of this FormatTest. # noqa: E501 - :type float: float - """ - if (self.local_vars_configuration.client_side_validation and - float is not None and float > 987.6): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - float is not None and float < 54.3): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 - - self._float = float - - @property - def double(self): - """Gets the double of this FormatTest. # noqa: E501 - - - :return: The double of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._double - - @double.setter - def double(self, double): - """Sets the double of this FormatTest. - - - :param double: The double of this FormatTest. # noqa: E501 - :type double: float - """ - if (self.local_vars_configuration.client_side_validation and - double is not None and double > 123.4): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double < 67.8): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - - self._double = double - - @property - def string(self): - """Gets the string of this FormatTest. # noqa: E501 - - - :return: The string of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this FormatTest. - - - :param string: The string of this FormatTest. # noqa: E501 - :type string: str - """ - if (self.local_vars_configuration.client_side_validation and - string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - - self._string = string - - @property - def byte(self): - """Gets the byte of this FormatTest. # noqa: E501 - - - :return: The byte of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._byte - - @byte.setter - def byte(self, byte): - """Sets the byte of this FormatTest. - - - :param byte: The byte of this FormatTest. # noqa: E501 - :type byte: str - """ - if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501 - raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 - - self._byte = byte - - @property - def binary(self): - """Gets the binary of this FormatTest. # noqa: E501 - - - :return: The binary of this FormatTest. # noqa: E501 - :rtype: file - """ - return self._binary - - @binary.setter - def binary(self, binary): - """Sets the binary of this FormatTest. - - - :param binary: The binary of this FormatTest. # noqa: E501 - :type binary: file - """ - - self._binary = binary - - @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 - - - :return: The date of this FormatTest. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this FormatTest. - - - :param date: The date of this FormatTest. # noqa: E501 - :type date: date - """ - if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def date_time(self): - """Gets the date_time of this FormatTest. # noqa: E501 - - - :return: The date_time of this FormatTest. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this FormatTest. - - - :param date_time: The date_time of this FormatTest. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def uuid(self): - """Gets the uuid of this FormatTest. # noqa: E501 - - - :return: The uuid of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this FormatTest. - - - :param uuid: The uuid of this FormatTest. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def password(self): - """Gets the password of this FormatTest. # noqa: E501 - - - :return: The password of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this FormatTest. - - - :param password: The password of this FormatTest. # noqa: E501 - :type password: str - """ - if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) > 64): - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) < 10): - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - - self._password = password - - @property - def big_decimal(self): - """Gets the big_decimal of this FormatTest. # noqa: E501 - - - :return: The big_decimal of this FormatTest. # noqa: E501 - :rtype: Decimal - """ - return self._big_decimal - - @big_decimal.setter - def big_decimal(self, big_decimal): - """Sets the big_decimal of this FormatTest. - - - :param big_decimal: The big_decimal of this FormatTest. # noqa: E501 - :type big_decimal: Decimal - """ - - self._big_decimal = big_decimal - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FormatTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FormatTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py deleted file mode 100644 index 7175c2acc721..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class HasOnlyReadOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'foo': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'foo': 'foo' - } - - def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._foo = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if foo is not None: - self.foo = foo - - @property - def bar(self): - """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - - - :return: The bar of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this HasOnlyReadOnly. - - - :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def foo(self): - """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - - - :return: The foo of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._foo - - @foo.setter - def foo(self, foo): - """Sets the foo of this HasOnlyReadOnly. - - - :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 - :type foo: str - """ - - self._foo = foo - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HasOnlyReadOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, HasOnlyReadOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/list.py b/samples/client/petstore/python-tornado/petstore_api/models/list.py deleted file mode 100644 index 6e1dea4e33b5..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/list.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class List(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_123_list': 'str' - } - - attribute_map = { - '_123_list': '123-list' - } - - def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 - """List - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__123_list = None - self.discriminator = None - - if _123_list is not None: - self._123_list = _123_list - - @property - def _123_list(self): - """Gets the _123_list of this List. # noqa: E501 - - - :return: The _123_list of this List. # noqa: E501 - :rtype: str - """ - return self.__123_list - - @_123_list.setter - def _123_list(self, _123_list): - """Sets the _123_list of this List. - - - :param _123_list: The _123_list of this List. # noqa: E501 - :type _123_list: str - """ - - self.__123_list = _123_list - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, List): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, List): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py deleted file mode 100644 index 606253a90d9e..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MapTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_map_of_string': 'dict[str, dict[str, str]]', - 'map_of_enum_string': 'dict[str, str]', - 'direct_map': 'dict[str, bool]', - 'indirect_map': 'dict[str, bool]' - } - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string', - 'direct_map': 'direct_map', - 'indirect_map': 'indirect_map' - } - - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 - """MapTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_map_of_string = None - self._map_of_enum_string = None - self._direct_map = None - self._indirect_map = None - self.discriminator = None - - if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string - if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string - if direct_map is not None: - self.direct_map = direct_map - if indirect_map is not None: - self.indirect_map = indirect_map - - @property - def map_map_of_string(self): - """Gets the map_map_of_string of this MapTest. # noqa: E501 - - - :return: The map_map_of_string of this MapTest. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_of_string - - @map_map_of_string.setter - def map_map_of_string(self, map_map_of_string): - """Sets the map_map_of_string of this MapTest. - - - :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 - :type map_map_of_string: dict[str, dict[str, str]] - """ - - self._map_map_of_string = map_map_of_string - - @property - def map_of_enum_string(self): - """Gets the map_of_enum_string of this MapTest. # noqa: E501 - - - :return: The map_of_enum_string of this MapTest. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_of_enum_string - - @map_of_enum_string.setter - def map_of_enum_string(self, map_of_enum_string): - """Sets the map_of_enum_string of this MapTest. - - - :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 - :type map_of_enum_string: dict[str, str] - """ - allowed_values = ["UPPER", "lower"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._map_of_enum_string = map_of_enum_string - - @property - def direct_map(self): - """Gets the direct_map of this MapTest. # noqa: E501 - - - :return: The direct_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._direct_map - - @direct_map.setter - def direct_map(self, direct_map): - """Sets the direct_map of this MapTest. - - - :param direct_map: The direct_map of this MapTest. # noqa: E501 - :type direct_map: dict[str, bool] - """ - - self._direct_map = direct_map - - @property - def indirect_map(self): - """Gets the indirect_map of this MapTest. # noqa: E501 - - - :return: The indirect_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._indirect_map - - @indirect_map.setter - def indirect_map(self, indirect_map): - """Sets the indirect_map of this MapTest. - - - :param indirect_map: The indirect_map of this MapTest. # noqa: E501 - :type indirect_map: dict[str, bool] - """ - - self._indirect_map = indirect_map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MapTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MapTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 96aedc145c40..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MixedPropertiesAndAdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict[str, Animal]' - } - - attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' - } - - def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._uuid = None - self._date_time = None - self._map = None - self.discriminator = None - - if uuid is not None: - self.uuid = uuid - if date_time is not None: - self.date_time = date_time - if map is not None: - self.map = map - - @property - def uuid(self): - """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def date_time(self): - """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def map(self): - """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, Animal] - """ - return self._map - - @map.setter - def map(self, map): - """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type map: dict[str, Animal] - """ - - self._map = map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py b/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py deleted file mode 100644 index db587fd24e2f..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/model200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - - :return: The name of this Model200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model200Response. - - - :param name: The name of this Model200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - - :return: The _class of this Model200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model200Response. - - - :param _class: The _class of this Model200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py b/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py deleted file mode 100644 index 96498ac6b1df..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model_200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model_200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model_200Response. # noqa: E501 - - - :return: The name of this Model_200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model_200Response. - - - :param name: The name of this Model_200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model_200Response. # noqa: E501 - - - :return: The _class of this Model_200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model_200Response. - - - :param _class: The _class of this Model_200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model_200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model_200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py deleted file mode 100644 index 5354fd56e2ce..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ModelReturn(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_return': 'int' - } - - attribute_map = { - '_return': 'return' - } - - def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__return = None - self.discriminator = None - - if _return is not None: - self._return = _return - - @property - def _return(self): - """Gets the _return of this ModelReturn. # noqa: E501 - - - :return: The _return of this ModelReturn. # noqa: E501 - :rtype: int - """ - return self.__return - - @_return.setter - def _return(self, _return): - """Sets the _return of this ModelReturn. - - - :param _return: The _return of this ModelReturn. # noqa: E501 - :type _return: int - """ - - self.__return = _return - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ModelReturn): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ModelReturn): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/name.py b/samples/client/petstore/python-tornado/petstore_api/models/name.py deleted file mode 100644 index 0191a3a934ae..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/name.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Name(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int' - } - - attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' - } - - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 - """Name - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._snake_case = None - self.__property = None - self.__123_number = None - self.discriminator = None - - self.name = name - if snake_case is not None: - self.snake_case = snake_case - if _property is not None: - self._property = _property - if _123_number is not None: - self._123_number = _123_number - - @property - def name(self): - """Gets the name of this Name. # noqa: E501 - - - :return: The name of this Name. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Name. - - - :param name: The name of this Name. # noqa: E501 - :type name: int - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def snake_case(self): - """Gets the snake_case of this Name. # noqa: E501 - - - :return: The snake_case of this Name. # noqa: E501 - :rtype: int - """ - return self._snake_case - - @snake_case.setter - def snake_case(self, snake_case): - """Sets the snake_case of this Name. - - - :param snake_case: The snake_case of this Name. # noqa: E501 - :type snake_case: int - """ - - self._snake_case = snake_case - - @property - def _property(self): - """Gets the _property of this Name. # noqa: E501 - - - :return: The _property of this Name. # noqa: E501 - :rtype: str - """ - return self.__property - - @_property.setter - def _property(self, _property): - """Sets the _property of this Name. - - - :param _property: The _property of this Name. # noqa: E501 - :type _property: str - """ - - self.__property = _property - - @property - def _123_number(self): - """Gets the _123_number of this Name. # noqa: E501 - - - :return: The _123_number of this Name. # noqa: E501 - :rtype: int - """ - return self.__123_number - - @_123_number.setter - def _123_number(self, _123_number): - """Sets the _123_number of this Name. - - - :param _123_number: The _123_number of this Name. # noqa: E501 - :type _123_number: int - """ - - self.__123_number = _123_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Name): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Name): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py deleted file mode 100644 index 59a252e0bb66..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class NumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_number': 'float' - } - - attribute_map = { - 'just_number': 'JustNumber' - } - - def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_number = None - self.discriminator = None - - if just_number is not None: - self.just_number = just_number - - @property - def just_number(self): - """Gets the just_number of this NumberOnly. # noqa: E501 - - - :return: The just_number of this NumberOnly. # noqa: E501 - :rtype: float - """ - return self._just_number - - @just_number.setter - def just_number(self, just_number): - """Sets the just_number of this NumberOnly. - - - :param just_number: The just_number of this NumberOnly. # noqa: E501 - :type just_number: float - """ - - self._just_number = just_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, NumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/order.py b/samples/client/petstore/python-tornado/petstore_api/models/order.py deleted file mode 100644 index a267324d0d19..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/order.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Order(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool' - } - - attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } - - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 - """Order - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._pet_id = None - self._quantity = None - self._ship_date = None - self._status = None - self._complete = None - self.discriminator = None - - if id is not None: - self.id = id - if pet_id is not None: - self.pet_id = pet_id - if quantity is not None: - self.quantity = quantity - if ship_date is not None: - self.ship_date = ship_date - if status is not None: - self.status = status - if complete is not None: - self.complete = complete - - @property - def id(self): - """Gets the id of this Order. # noqa: E501 - - - :return: The id of this Order. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Order. - - - :param id: The id of this Order. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def pet_id(self): - """Gets the pet_id of this Order. # noqa: E501 - - - :return: The pet_id of this Order. # noqa: E501 - :rtype: int - """ - return self._pet_id - - @pet_id.setter - def pet_id(self, pet_id): - """Sets the pet_id of this Order. - - - :param pet_id: The pet_id of this Order. # noqa: E501 - :type pet_id: int - """ - - self._pet_id = pet_id - - @property - def quantity(self): - """Gets the quantity of this Order. # noqa: E501 - - - :return: The quantity of this Order. # noqa: E501 - :rtype: int - """ - return self._quantity - - @quantity.setter - def quantity(self, quantity): - """Sets the quantity of this Order. - - - :param quantity: The quantity of this Order. # noqa: E501 - :type quantity: int - """ - - self._quantity = quantity - - @property - def ship_date(self): - """Gets the ship_date of this Order. # noqa: E501 - - - :return: The ship_date of this Order. # noqa: E501 - :rtype: datetime - """ - return self._ship_date - - @ship_date.setter - def ship_date(self, ship_date): - """Sets the ship_date of this Order. - - - :param ship_date: The ship_date of this Order. # noqa: E501 - :type ship_date: datetime - """ - - self._ship_date = ship_date - - @property - def status(self): - """Gets the status of this Order. # noqa: E501 - - Order Status # noqa: E501 - - :return: The status of this Order. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Order. - - Order Status # noqa: E501 - - :param status: The status of this Order. # noqa: E501 - :type status: str - """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def complete(self): - """Gets the complete of this Order. # noqa: E501 - - - :return: The complete of this Order. # noqa: E501 - :rtype: bool - """ - return self._complete - - @complete.setter - def complete(self, complete): - """Sets the complete of this Order. - - - :param complete: The complete of this Order. # noqa: E501 - :type complete: bool - """ - - self._complete = complete - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Order): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Order): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py deleted file mode 100644 index e26160ab4302..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterComposite(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'my_number': 'float', - 'my_string': 'str', - 'my_boolean': 'bool' - } - - attribute_map = { - 'my_number': 'my_number', - 'my_string': 'my_string', - 'my_boolean': 'my_boolean' - } - - def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._my_number = None - self._my_string = None - self._my_boolean = None - self.discriminator = None - - if my_number is not None: - self.my_number = my_number - if my_string is not None: - self.my_string = my_string - if my_boolean is not None: - self.my_boolean = my_boolean - - @property - def my_number(self): - """Gets the my_number of this OuterComposite. # noqa: E501 - - - :return: The my_number of this OuterComposite. # noqa: E501 - :rtype: float - """ - return self._my_number - - @my_number.setter - def my_number(self, my_number): - """Sets the my_number of this OuterComposite. - - - :param my_number: The my_number of this OuterComposite. # noqa: E501 - :type my_number: float - """ - - self._my_number = my_number - - @property - def my_string(self): - """Gets the my_string of this OuterComposite. # noqa: E501 - - - :return: The my_string of this OuterComposite. # noqa: E501 - :rtype: str - """ - return self._my_string - - @my_string.setter - def my_string(self, my_string): - """Sets the my_string of this OuterComposite. - - - :param my_string: The my_string of this OuterComposite. # noqa: E501 - :type my_string: str - """ - - self._my_string = my_string - - @property - def my_boolean(self): - """Gets the my_boolean of this OuterComposite. # noqa: E501 - - - :return: The my_boolean of this OuterComposite. # noqa: E501 - :rtype: bool - """ - return self._my_boolean - - @my_boolean.setter - def my_boolean(self, my_boolean): - """Sets the my_boolean of this OuterComposite. - - - :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 - :type my_boolean: bool - """ - - self._my_boolean = my_boolean - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterComposite): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterComposite): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py deleted file mode 100644 index 27cdfd1fb791..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnum(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - - allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnum - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnum): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnum): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/pet.py b/samples/client/petstore/python-tornado/petstore_api/models/pet.py deleted file mode 100644 index 22bb4a585e47..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/pet.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Pet(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'category': 'Category', - 'name': 'str', - 'photo_urls': 'list[str]', - 'tags': 'list[Tag]', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } - - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 - """Pet - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._category = None - self._name = None - self._photo_urls = None - self._tags = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - if category is not None: - self.category = category - self.name = name - self.photo_urls = photo_urls - if tags is not None: - self.tags = tags - if status is not None: - self.status = status - - @property - def id(self): - """Gets the id of this Pet. # noqa: E501 - - - :return: The id of this Pet. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Pet. - - - :param id: The id of this Pet. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def category(self): - """Gets the category of this Pet. # noqa: E501 - - - :return: The category of this Pet. # noqa: E501 - :rtype: Category - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Pet. - - - :param category: The category of this Pet. # noqa: E501 - :type category: Category - """ - - self._category = category - - @property - def name(self): - """Gets the name of this Pet. # noqa: E501 - - - :return: The name of this Pet. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Pet. - - - :param name: The name of this Pet. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. # noqa: E501 - - - :return: The photo_urls of this Pet. # noqa: E501 - :rtype: list[str] - """ - return self._photo_urls - - @photo_urls.setter - def photo_urls(self, photo_urls): - """Sets the photo_urls of this Pet. - - - :param photo_urls: The photo_urls of this Pet. # noqa: E501 - :type photo_urls: list[str] - """ - if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 - raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 - - self._photo_urls = photo_urls - - @property - def tags(self): - """Gets the tags of this Pet. # noqa: E501 - - - :return: The tags of this Pet. # noqa: E501 - :rtype: list[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Pet. - - - :param tags: The tags of this Pet. # noqa: E501 - :type tags: list[Tag] - """ - - self._tags = tags - - @property - def status(self): - """Gets the status of this Pet. # noqa: E501 - - pet status in the store # noqa: E501 - - :return: The status of this Pet. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Pet. - - pet status in the store # noqa: E501 - - :param status: The status of this Pet. # noqa: E501 - :type status: str - """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Pet): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Pet): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py deleted file mode 100644 index c2888eba7500..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ReadOnlyFirst(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'baz': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'baz': 'baz' - } - - def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._baz = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if baz is not None: - self.baz = baz - - @property - def bar(self): - """Gets the bar of this ReadOnlyFirst. # noqa: E501 - - - :return: The bar of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this ReadOnlyFirst. - - - :param bar: The bar of this ReadOnlyFirst. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def baz(self): - """Gets the baz of this ReadOnlyFirst. # noqa: E501 - - - :return: The baz of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._baz - - @baz.setter - def baz(self, baz): - """Sets the baz of this ReadOnlyFirst. - - - :param baz: The baz of this ReadOnlyFirst. # noqa: E501 - :type baz: str - """ - - self._baz = baz - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ReadOnlyFirst): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ReadOnlyFirst): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py deleted file mode 100644 index 4c848e1887c0..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialModelName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'special_property_name': 'int' - } - - attribute_map = { - 'special_property_name': '$special[property.name]' - } - - def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._special_property_name = None - self.discriminator = None - - if special_property_name is not None: - self.special_property_name = special_property_name - - @property - def special_property_name(self): - """Gets the special_property_name of this SpecialModelName. # noqa: E501 - - - :return: The special_property_name of this SpecialModelName. # noqa: E501 - :rtype: int - """ - return self._special_property_name - - @special_property_name.setter - def special_property_name(self, special_property_name): - """Sets the special_property_name of this SpecialModelName. - - - :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 - :type special_property_name: int - """ - - self._special_property_name = special_property_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialModelName): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialModelName): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/tag.py b/samples/client/petstore/python-tornado/petstore_api/models/tag.py deleted file mode 100644 index a3e6789078d8..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/tag.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Tag(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 - """Tag - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - - :return: The id of this Tag. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - - :return: The name of this Tag. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - - :param name: The name of this Tag. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Tag): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py deleted file mode 100644 index 582b4c8d6dc2..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py +++ /dev/null @@ -1,240 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderDefault(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderDefault. # noqa: E501 - - - :return: The string_item of this TypeHolderDefault. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderDefault. - - - :param string_item: The string_item of this TypeHolderDefault. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderDefault. # noqa: E501 - - - :return: The number_item of this TypeHolderDefault. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderDefault. - - - :param number_item: The number_item of this TypeHolderDefault. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderDefault. # noqa: E501 - - - :return: The integer_item of this TypeHolderDefault. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderDefault. - - - :param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderDefault. # noqa: E501 - - - :return: The bool_item of this TypeHolderDefault. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderDefault. - - - :param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderDefault. # noqa: E501 - - - :return: The array_item of this TypeHolderDefault. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderDefault. - - - :param array_item: The array_item of this TypeHolderDefault. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderDefault): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderDefault): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py deleted file mode 100644 index 268595ed8681..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py +++ /dev/null @@ -1,267 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class TypeHolderExample(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'float_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]' - } - - attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'float_item': 'float_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' - } - - def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None, local_vars_configuration=None): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string_item = None - self._number_item = None - self._float_item = None - self._integer_item = None - self._bool_item = None - self._array_item = None - self.discriminator = None - - self.string_item = string_item - self.number_item = number_item - self.float_item = float_item - self.integer_item = integer_item - self.bool_item = bool_item - self.array_item = array_item - - @property - def string_item(self): - """Gets the string_item of this TypeHolderExample. # noqa: E501 - - - :return: The string_item of this TypeHolderExample. # noqa: E501 - :rtype: str - """ - return self._string_item - - @string_item.setter - def string_item(self, string_item): - """Sets the string_item of this TypeHolderExample. - - - :param string_item: The string_item of this TypeHolderExample. # noqa: E501 - :type string_item: str - """ - if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - - self._string_item = string_item - - @property - def number_item(self): - """Gets the number_item of this TypeHolderExample. # noqa: E501 - - - :return: The number_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._number_item - - @number_item.setter - def number_item(self, number_item): - """Sets the number_item of this TypeHolderExample. - - - :param number_item: The number_item of this TypeHolderExample. # noqa: E501 - :type number_item: float - """ - if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - - self._number_item = number_item - - @property - def float_item(self): - """Gets the float_item of this TypeHolderExample. # noqa: E501 - - - :return: The float_item of this TypeHolderExample. # noqa: E501 - :rtype: float - """ - return self._float_item - - @float_item.setter - def float_item(self, float_item): - """Sets the float_item of this TypeHolderExample. - - - :param float_item: The float_item of this TypeHolderExample. # noqa: E501 - :type float_item: float - """ - if self.local_vars_configuration.client_side_validation and float_item is None: # noqa: E501 - raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 - - self._float_item = float_item - - @property - def integer_item(self): - """Gets the integer_item of this TypeHolderExample. # noqa: E501 - - - :return: The integer_item of this TypeHolderExample. # noqa: E501 - :rtype: int - """ - return self._integer_item - - @integer_item.setter - def integer_item(self, integer_item): - """Sets the integer_item of this TypeHolderExample. - - - :param integer_item: The integer_item of this TypeHolderExample. # noqa: E501 - :type integer_item: int - """ - if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - - self._integer_item = integer_item - - @property - def bool_item(self): - """Gets the bool_item of this TypeHolderExample. # noqa: E501 - - - :return: The bool_item of this TypeHolderExample. # noqa: E501 - :rtype: bool - """ - return self._bool_item - - @bool_item.setter - def bool_item(self, bool_item): - """Sets the bool_item of this TypeHolderExample. - - - :param bool_item: The bool_item of this TypeHolderExample. # noqa: E501 - :type bool_item: bool - """ - if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - - self._bool_item = bool_item - - @property - def array_item(self): - """Gets the array_item of this TypeHolderExample. # noqa: E501 - - - :return: The array_item of this TypeHolderExample. # noqa: E501 - :rtype: list[int] - """ - return self._array_item - - @array_item.setter - def array_item(self, array_item): - """Sets the array_item of this TypeHolderExample. - - - :param array_item: The array_item of this TypeHolderExample. # noqa: E501 - :type array_item: list[int] - """ - if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - - self._array_item = array_item - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TypeHolderExample): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TypeHolderExample): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/user.py b/samples/client/petstore/python-tornado/petstore_api/models/user.py deleted file mode 100644 index 7ae2898f6c5a..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/user.py +++ /dev/null @@ -1,315 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class User(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int' - } - - attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } - - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 - """User - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._username = None - self._first_name = None - self._last_name = None - self._email = None - self._password = None - self._phone = None - self._user_status = None - self.discriminator = None - - if id is not None: - self.id = id - if username is not None: - self.username = username - if first_name is not None: - self.first_name = first_name - if last_name is not None: - self.last_name = last_name - if email is not None: - self.email = email - if password is not None: - self.password = password - if phone is not None: - self.phone = phone - if user_status is not None: - self.user_status = user_status - - @property - def id(self): - """Gets the id of this User. # noqa: E501 - - - :return: The id of this User. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this User. - - - :param id: The id of this User. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def username(self): - """Gets the username of this User. # noqa: E501 - - - :return: The username of this User. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this User. - - - :param username: The username of this User. # noqa: E501 - :type username: str - """ - - self._username = username - - @property - def first_name(self): - """Gets the first_name of this User. # noqa: E501 - - - :return: The first_name of this User. # noqa: E501 - :rtype: str - """ - return self._first_name - - @first_name.setter - def first_name(self, first_name): - """Sets the first_name of this User. - - - :param first_name: The first_name of this User. # noqa: E501 - :type first_name: str - """ - - self._first_name = first_name - - @property - def last_name(self): - """Gets the last_name of this User. # noqa: E501 - - - :return: The last_name of this User. # noqa: E501 - :rtype: str - """ - return self._last_name - - @last_name.setter - def last_name(self, last_name): - """Sets the last_name of this User. - - - :param last_name: The last_name of this User. # noqa: E501 - :type last_name: str - """ - - self._last_name = last_name - - @property - def email(self): - """Gets the email of this User. # noqa: E501 - - - :return: The email of this User. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this User. - - - :param email: The email of this User. # noqa: E501 - :type email: str - """ - - self._email = email - - @property - def password(self): - """Gets the password of this User. # noqa: E501 - - - :return: The password of this User. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this User. - - - :param password: The password of this User. # noqa: E501 - :type password: str - """ - - self._password = password - - @property - def phone(self): - """Gets the phone of this User. # noqa: E501 - - - :return: The phone of this User. # noqa: E501 - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this User. - - - :param phone: The phone of this User. # noqa: E501 - :type phone: str - """ - - self._phone = phone - - @property - def user_status(self): - """Gets the user_status of this User. # noqa: E501 - - User Status # noqa: E501 - - :return: The user_status of this User. # noqa: E501 - :rtype: int - """ - return self._user_status - - @user_status.setter - def user_status(self, user_status): - """Sets the user_status of this User. - - User Status # noqa: E501 - - :param user_status: The user_status of this User. # noqa: E501 - :type user_status: int - """ - - self._user_status = user_status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, User): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, User): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/xml_item.py b/samples/client/petstore/python-tornado/petstore_api/models/xml_item.py deleted file mode 100644 index 5e6fecdd71c8..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/models/xml_item.py +++ /dev/null @@ -1,859 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class XmlItem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'attribute_string': 'str', - 'attribute_number': 'float', - 'attribute_integer': 'int', - 'attribute_boolean': 'bool', - 'wrapped_array': 'list[int]', - 'name_string': 'str', - 'name_number': 'float', - 'name_integer': 'int', - 'name_boolean': 'bool', - 'name_array': 'list[int]', - 'name_wrapped_array': 'list[int]', - 'prefix_string': 'str', - 'prefix_number': 'float', - 'prefix_integer': 'int', - 'prefix_boolean': 'bool', - 'prefix_array': 'list[int]', - 'prefix_wrapped_array': 'list[int]', - 'namespace_string': 'str', - 'namespace_number': 'float', - 'namespace_integer': 'int', - 'namespace_boolean': 'bool', - 'namespace_array': 'list[int]', - 'namespace_wrapped_array': 'list[int]', - 'prefix_ns_string': 'str', - 'prefix_ns_number': 'float', - 'prefix_ns_integer': 'int', - 'prefix_ns_boolean': 'bool', - 'prefix_ns_array': 'list[int]', - 'prefix_ns_wrapped_array': 'list[int]' - } - - attribute_map = { - 'attribute_string': 'attribute_string', - 'attribute_number': 'attribute_number', - 'attribute_integer': 'attribute_integer', - 'attribute_boolean': 'attribute_boolean', - 'wrapped_array': 'wrapped_array', - 'name_string': 'name_string', - 'name_number': 'name_number', - 'name_integer': 'name_integer', - 'name_boolean': 'name_boolean', - 'name_array': 'name_array', - 'name_wrapped_array': 'name_wrapped_array', - 'prefix_string': 'prefix_string', - 'prefix_number': 'prefix_number', - 'prefix_integer': 'prefix_integer', - 'prefix_boolean': 'prefix_boolean', - 'prefix_array': 'prefix_array', - 'prefix_wrapped_array': 'prefix_wrapped_array', - 'namespace_string': 'namespace_string', - 'namespace_number': 'namespace_number', - 'namespace_integer': 'namespace_integer', - 'namespace_boolean': 'namespace_boolean', - 'namespace_array': 'namespace_array', - 'namespace_wrapped_array': 'namespace_wrapped_array', - 'prefix_ns_string': 'prefix_ns_string', - 'prefix_ns_number': 'prefix_ns_number', - 'prefix_ns_integer': 'prefix_ns_integer', - 'prefix_ns_boolean': 'prefix_ns_boolean', - 'prefix_ns_array': 'prefix_ns_array', - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' - } - - def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None, local_vars_configuration=None): # noqa: E501 - """XmlItem - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._attribute_string = None - self._attribute_number = None - self._attribute_integer = None - self._attribute_boolean = None - self._wrapped_array = None - self._name_string = None - self._name_number = None - self._name_integer = None - self._name_boolean = None - self._name_array = None - self._name_wrapped_array = None - self._prefix_string = None - self._prefix_number = None - self._prefix_integer = None - self._prefix_boolean = None - self._prefix_array = None - self._prefix_wrapped_array = None - self._namespace_string = None - self._namespace_number = None - self._namespace_integer = None - self._namespace_boolean = None - self._namespace_array = None - self._namespace_wrapped_array = None - self._prefix_ns_string = None - self._prefix_ns_number = None - self._prefix_ns_integer = None - self._prefix_ns_boolean = None - self._prefix_ns_array = None - self._prefix_ns_wrapped_array = None - self.discriminator = None - - if attribute_string is not None: - self.attribute_string = attribute_string - if attribute_number is not None: - self.attribute_number = attribute_number - if attribute_integer is not None: - self.attribute_integer = attribute_integer - if attribute_boolean is not None: - self.attribute_boolean = attribute_boolean - if wrapped_array is not None: - self.wrapped_array = wrapped_array - if name_string is not None: - self.name_string = name_string - if name_number is not None: - self.name_number = name_number - if name_integer is not None: - self.name_integer = name_integer - if name_boolean is not None: - self.name_boolean = name_boolean - if name_array is not None: - self.name_array = name_array - if name_wrapped_array is not None: - self.name_wrapped_array = name_wrapped_array - if prefix_string is not None: - self.prefix_string = prefix_string - if prefix_number is not None: - self.prefix_number = prefix_number - if prefix_integer is not None: - self.prefix_integer = prefix_integer - if prefix_boolean is not None: - self.prefix_boolean = prefix_boolean - if prefix_array is not None: - self.prefix_array = prefix_array - if prefix_wrapped_array is not None: - self.prefix_wrapped_array = prefix_wrapped_array - if namespace_string is not None: - self.namespace_string = namespace_string - if namespace_number is not None: - self.namespace_number = namespace_number - if namespace_integer is not None: - self.namespace_integer = namespace_integer - if namespace_boolean is not None: - self.namespace_boolean = namespace_boolean - if namespace_array is not None: - self.namespace_array = namespace_array - if namespace_wrapped_array is not None: - self.namespace_wrapped_array = namespace_wrapped_array - if prefix_ns_string is not None: - self.prefix_ns_string = prefix_ns_string - if prefix_ns_number is not None: - self.prefix_ns_number = prefix_ns_number - if prefix_ns_integer is not None: - self.prefix_ns_integer = prefix_ns_integer - if prefix_ns_boolean is not None: - self.prefix_ns_boolean = prefix_ns_boolean - if prefix_ns_array is not None: - self.prefix_ns_array = prefix_ns_array - if prefix_ns_wrapped_array is not None: - self.prefix_ns_wrapped_array = prefix_ns_wrapped_array - - @property - def attribute_string(self): - """Gets the attribute_string of this XmlItem. # noqa: E501 - - - :return: The attribute_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._attribute_string - - @attribute_string.setter - def attribute_string(self, attribute_string): - """Sets the attribute_string of this XmlItem. - - - :param attribute_string: The attribute_string of this XmlItem. # noqa: E501 - :type attribute_string: str - """ - - self._attribute_string = attribute_string - - @property - def attribute_number(self): - """Gets the attribute_number of this XmlItem. # noqa: E501 - - - :return: The attribute_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._attribute_number - - @attribute_number.setter - def attribute_number(self, attribute_number): - """Sets the attribute_number of this XmlItem. - - - :param attribute_number: The attribute_number of this XmlItem. # noqa: E501 - :type attribute_number: float - """ - - self._attribute_number = attribute_number - - @property - def attribute_integer(self): - """Gets the attribute_integer of this XmlItem. # noqa: E501 - - - :return: The attribute_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._attribute_integer - - @attribute_integer.setter - def attribute_integer(self, attribute_integer): - """Sets the attribute_integer of this XmlItem. - - - :param attribute_integer: The attribute_integer of this XmlItem. # noqa: E501 - :type attribute_integer: int - """ - - self._attribute_integer = attribute_integer - - @property - def attribute_boolean(self): - """Gets the attribute_boolean of this XmlItem. # noqa: E501 - - - :return: The attribute_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._attribute_boolean - - @attribute_boolean.setter - def attribute_boolean(self, attribute_boolean): - """Sets the attribute_boolean of this XmlItem. - - - :param attribute_boolean: The attribute_boolean of this XmlItem. # noqa: E501 - :type attribute_boolean: bool - """ - - self._attribute_boolean = attribute_boolean - - @property - def wrapped_array(self): - """Gets the wrapped_array of this XmlItem. # noqa: E501 - - - :return: The wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._wrapped_array - - @wrapped_array.setter - def wrapped_array(self, wrapped_array): - """Sets the wrapped_array of this XmlItem. - - - :param wrapped_array: The wrapped_array of this XmlItem. # noqa: E501 - :type wrapped_array: list[int] - """ - - self._wrapped_array = wrapped_array - - @property - def name_string(self): - """Gets the name_string of this XmlItem. # noqa: E501 - - - :return: The name_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._name_string - - @name_string.setter - def name_string(self, name_string): - """Sets the name_string of this XmlItem. - - - :param name_string: The name_string of this XmlItem. # noqa: E501 - :type name_string: str - """ - - self._name_string = name_string - - @property - def name_number(self): - """Gets the name_number of this XmlItem. # noqa: E501 - - - :return: The name_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._name_number - - @name_number.setter - def name_number(self, name_number): - """Sets the name_number of this XmlItem. - - - :param name_number: The name_number of this XmlItem. # noqa: E501 - :type name_number: float - """ - - self._name_number = name_number - - @property - def name_integer(self): - """Gets the name_integer of this XmlItem. # noqa: E501 - - - :return: The name_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._name_integer - - @name_integer.setter - def name_integer(self, name_integer): - """Sets the name_integer of this XmlItem. - - - :param name_integer: The name_integer of this XmlItem. # noqa: E501 - :type name_integer: int - """ - - self._name_integer = name_integer - - @property - def name_boolean(self): - """Gets the name_boolean of this XmlItem. # noqa: E501 - - - :return: The name_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._name_boolean - - @name_boolean.setter - def name_boolean(self, name_boolean): - """Sets the name_boolean of this XmlItem. - - - :param name_boolean: The name_boolean of this XmlItem. # noqa: E501 - :type name_boolean: bool - """ - - self._name_boolean = name_boolean - - @property - def name_array(self): - """Gets the name_array of this XmlItem. # noqa: E501 - - - :return: The name_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_array - - @name_array.setter - def name_array(self, name_array): - """Sets the name_array of this XmlItem. - - - :param name_array: The name_array of this XmlItem. # noqa: E501 - :type name_array: list[int] - """ - - self._name_array = name_array - - @property - def name_wrapped_array(self): - """Gets the name_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The name_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._name_wrapped_array - - @name_wrapped_array.setter - def name_wrapped_array(self, name_wrapped_array): - """Sets the name_wrapped_array of this XmlItem. - - - :param name_wrapped_array: The name_wrapped_array of this XmlItem. # noqa: E501 - :type name_wrapped_array: list[int] - """ - - self._name_wrapped_array = name_wrapped_array - - @property - def prefix_string(self): - """Gets the prefix_string of this XmlItem. # noqa: E501 - - - :return: The prefix_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_string - - @prefix_string.setter - def prefix_string(self, prefix_string): - """Sets the prefix_string of this XmlItem. - - - :param prefix_string: The prefix_string of this XmlItem. # noqa: E501 - :type prefix_string: str - """ - - self._prefix_string = prefix_string - - @property - def prefix_number(self): - """Gets the prefix_number of this XmlItem. # noqa: E501 - - - :return: The prefix_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_number - - @prefix_number.setter - def prefix_number(self, prefix_number): - """Sets the prefix_number of this XmlItem. - - - :param prefix_number: The prefix_number of this XmlItem. # noqa: E501 - :type prefix_number: float - """ - - self._prefix_number = prefix_number - - @property - def prefix_integer(self): - """Gets the prefix_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_integer - - @prefix_integer.setter - def prefix_integer(self, prefix_integer): - """Sets the prefix_integer of this XmlItem. - - - :param prefix_integer: The prefix_integer of this XmlItem. # noqa: E501 - :type prefix_integer: int - """ - - self._prefix_integer = prefix_integer - - @property - def prefix_boolean(self): - """Gets the prefix_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_boolean - - @prefix_boolean.setter - def prefix_boolean(self, prefix_boolean): - """Sets the prefix_boolean of this XmlItem. - - - :param prefix_boolean: The prefix_boolean of this XmlItem. # noqa: E501 - :type prefix_boolean: bool - """ - - self._prefix_boolean = prefix_boolean - - @property - def prefix_array(self): - """Gets the prefix_array of this XmlItem. # noqa: E501 - - - :return: The prefix_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_array - - @prefix_array.setter - def prefix_array(self, prefix_array): - """Sets the prefix_array of this XmlItem. - - - :param prefix_array: The prefix_array of this XmlItem. # noqa: E501 - :type prefix_array: list[int] - """ - - self._prefix_array = prefix_array - - @property - def prefix_wrapped_array(self): - """Gets the prefix_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_wrapped_array - - @prefix_wrapped_array.setter - def prefix_wrapped_array(self, prefix_wrapped_array): - """Sets the prefix_wrapped_array of this XmlItem. - - - :param prefix_wrapped_array: The prefix_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_wrapped_array: list[int] - """ - - self._prefix_wrapped_array = prefix_wrapped_array - - @property - def namespace_string(self): - """Gets the namespace_string of this XmlItem. # noqa: E501 - - - :return: The namespace_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._namespace_string - - @namespace_string.setter - def namespace_string(self, namespace_string): - """Sets the namespace_string of this XmlItem. - - - :param namespace_string: The namespace_string of this XmlItem. # noqa: E501 - :type namespace_string: str - """ - - self._namespace_string = namespace_string - - @property - def namespace_number(self): - """Gets the namespace_number of this XmlItem. # noqa: E501 - - - :return: The namespace_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._namespace_number - - @namespace_number.setter - def namespace_number(self, namespace_number): - """Sets the namespace_number of this XmlItem. - - - :param namespace_number: The namespace_number of this XmlItem. # noqa: E501 - :type namespace_number: float - """ - - self._namespace_number = namespace_number - - @property - def namespace_integer(self): - """Gets the namespace_integer of this XmlItem. # noqa: E501 - - - :return: The namespace_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._namespace_integer - - @namespace_integer.setter - def namespace_integer(self, namespace_integer): - """Sets the namespace_integer of this XmlItem. - - - :param namespace_integer: The namespace_integer of this XmlItem. # noqa: E501 - :type namespace_integer: int - """ - - self._namespace_integer = namespace_integer - - @property - def namespace_boolean(self): - """Gets the namespace_boolean of this XmlItem. # noqa: E501 - - - :return: The namespace_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._namespace_boolean - - @namespace_boolean.setter - def namespace_boolean(self, namespace_boolean): - """Sets the namespace_boolean of this XmlItem. - - - :param namespace_boolean: The namespace_boolean of this XmlItem. # noqa: E501 - :type namespace_boolean: bool - """ - - self._namespace_boolean = namespace_boolean - - @property - def namespace_array(self): - """Gets the namespace_array of this XmlItem. # noqa: E501 - - - :return: The namespace_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_array - - @namespace_array.setter - def namespace_array(self, namespace_array): - """Sets the namespace_array of this XmlItem. - - - :param namespace_array: The namespace_array of this XmlItem. # noqa: E501 - :type namespace_array: list[int] - """ - - self._namespace_array = namespace_array - - @property - def namespace_wrapped_array(self): - """Gets the namespace_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._namespace_wrapped_array - - @namespace_wrapped_array.setter - def namespace_wrapped_array(self, namespace_wrapped_array): - """Sets the namespace_wrapped_array of this XmlItem. - - - :param namespace_wrapped_array: The namespace_wrapped_array of this XmlItem. # noqa: E501 - :type namespace_wrapped_array: list[int] - """ - - self._namespace_wrapped_array = namespace_wrapped_array - - @property - def prefix_ns_string(self): - """Gets the prefix_ns_string of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_string of this XmlItem. # noqa: E501 - :rtype: str - """ - return self._prefix_ns_string - - @prefix_ns_string.setter - def prefix_ns_string(self, prefix_ns_string): - """Sets the prefix_ns_string of this XmlItem. - - - :param prefix_ns_string: The prefix_ns_string of this XmlItem. # noqa: E501 - :type prefix_ns_string: str - """ - - self._prefix_ns_string = prefix_ns_string - - @property - def prefix_ns_number(self): - """Gets the prefix_ns_number of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_number of this XmlItem. # noqa: E501 - :rtype: float - """ - return self._prefix_ns_number - - @prefix_ns_number.setter - def prefix_ns_number(self, prefix_ns_number): - """Sets the prefix_ns_number of this XmlItem. - - - :param prefix_ns_number: The prefix_ns_number of this XmlItem. # noqa: E501 - :type prefix_ns_number: float - """ - - self._prefix_ns_number = prefix_ns_number - - @property - def prefix_ns_integer(self): - """Gets the prefix_ns_integer of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_integer of this XmlItem. # noqa: E501 - :rtype: int - """ - return self._prefix_ns_integer - - @prefix_ns_integer.setter - def prefix_ns_integer(self, prefix_ns_integer): - """Sets the prefix_ns_integer of this XmlItem. - - - :param prefix_ns_integer: The prefix_ns_integer of this XmlItem. # noqa: E501 - :type prefix_ns_integer: int - """ - - self._prefix_ns_integer = prefix_ns_integer - - @property - def prefix_ns_boolean(self): - """Gets the prefix_ns_boolean of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :rtype: bool - """ - return self._prefix_ns_boolean - - @prefix_ns_boolean.setter - def prefix_ns_boolean(self, prefix_ns_boolean): - """Sets the prefix_ns_boolean of this XmlItem. - - - :param prefix_ns_boolean: The prefix_ns_boolean of this XmlItem. # noqa: E501 - :type prefix_ns_boolean: bool - """ - - self._prefix_ns_boolean = prefix_ns_boolean - - @property - def prefix_ns_array(self): - """Gets the prefix_ns_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_array - - @prefix_ns_array.setter - def prefix_ns_array(self, prefix_ns_array): - """Sets the prefix_ns_array of this XmlItem. - - - :param prefix_ns_array: The prefix_ns_array of this XmlItem. # noqa: E501 - :type prefix_ns_array: list[int] - """ - - self._prefix_ns_array = prefix_ns_array - - @property - def prefix_ns_wrapped_array(self): - """Gets the prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - - - :return: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :rtype: list[int] - """ - return self._prefix_ns_wrapped_array - - @prefix_ns_wrapped_array.setter - def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): - """Sets the prefix_ns_wrapped_array of this XmlItem. - - - :param prefix_ns_wrapped_array: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 - :type prefix_ns_wrapped_array: list[int] - """ - - self._prefix_ns_wrapped_array = prefix_ns_wrapped_array - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, XmlItem): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, XmlItem): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python-tornado/petstore_api/rest.py b/samples/client/petstore/python-tornado/petstore_api/rest.py deleted file mode 100644 index f3f274480a6a..000000000000 --- a/samples/client/petstore/python-tornado/petstore_api/rest.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re - -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode -import tornado -import tornado.gen -from tornado import httpclient -from urllib3.filepost import encode_multipart_formdata - -from petstore_api.exceptions import ApiException, ApiValueError - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.tornado_response = resp - self.status = resp.code - self.reason = resp.reason - - if resp.body: - self.data = resp.body - else: - self.data = None - - def getheaders(self): - """Returns a CIMultiDictProxy of the response headers.""" - return self.tornado_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.tornado_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=4): - # maxsize is number of requests to host that are allowed in parallel - - self.ca_certs = configuration.ssl_ca_cert - self.client_key = configuration.key_file - self.client_cert = configuration.cert_file - - self.proxy_port = self.proxy_host = None - - # https pool manager - if configuration.proxy: - self.proxy_port = 80 - self.proxy_host = configuration.proxy - - self.pool_manager = httpclient.AsyncHTTPClient() - - @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, body=None, - post_params=None, _preload_content=True, - _request_timeout=None): - """Execute Request - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - request = httpclient.HTTPRequest(url) - request.allow_nonstandard_methods = True - request.ca_certs = self.ca_certs - request.client_key = self.client_key - request.client_cert = self.client_cert - request.proxy_host = self.proxy_host - request.proxy_port = self.proxy_port - request.method = method - if headers: - request.headers = headers - if 'Content-Type' not in headers: - request.headers['Content-Type'] = 'application/json' - request.request_timeout = _request_timeout or 5 * 60 - - post_params = post_params or {} - - if query_params: - request.url += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body: - body = json.dumps(body) - request.body = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - request.body = urlencode(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - multipart = encode_multipart_formdata(post_params) - request.body, headers['Content-Type'] = multipart - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - request.body = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = yield self.pool_manager.fetch(request, raise_error=False) - - if _preload_content: - - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - raise tornado.gen.Return(r) - - @tornado.gen.coroutine - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - result = yield self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) diff --git a/samples/client/petstore/python-tornado/pom.xml b/samples/client/petstore/python-tornado/pom.xml deleted file mode 100644 index 9aae57304fc7..000000000000 --- a/samples/client/petstore/python-tornado/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonTornadoClientTests - pom - 1.0-SNAPSHOT - Python Tornado Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test-all - - - - - - - - diff --git a/samples/client/petstore/python-tornado/requirements.txt b/samples/client/petstore/python-tornado/requirements.txt deleted file mode 100644 index d0518ec800e9..000000000000 --- a/samples/client/petstore/python-tornado/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/client/petstore/python-tornado/setup.cfg b/samples/client/petstore/python-tornado/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/client/petstore/python-tornado/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py deleted file mode 100644 index db9d6f380256..000000000000 --- a/samples/client/petstore/python-tornado/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] -REQUIRES.append("tornado>=4.2,<5") - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description_content_type='text/markdown', - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/client/petstore/python-tornado/test-requirements.txt b/samples/client/petstore/python-tornado/test-requirements.txt deleted file mode 100644 index 4ed3991cbec1..000000000000 --- a/samples/client/petstore/python-tornado/test-requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/client/petstore/python-tornado/test/__init__.py b/samples/client/petstore/python-tornado/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_any_type.py b/samples/client/petstore/python-tornado/test/test_additional_properties_any_type.py deleted file mode 100644 index 4b6739a1faf3..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_any_type.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesAnyType(unittest.TestCase): - """AdditionalPropertiesAnyType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesAnyType(self): - """Test AdditionalPropertiesAnyType""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_array.py b/samples/client/petstore/python-tornado/test/test_additional_properties_array.py deleted file mode 100644 index c4cf43499cfa..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_array.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesArray(unittest.TestCase): - """AdditionalPropertiesArray unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesArray(self): - """Test AdditionalPropertiesArray""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_array.AdditionalPropertiesArray() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_boolean.py b/samples/client/petstore/python-tornado/test/test_additional_properties_boolean.py deleted file mode 100644 index cc3cecc8522f..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_boolean.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesBoolean(unittest.TestCase): - """AdditionalPropertiesBoolean unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesBoolean(self): - """Test AdditionalPropertiesBoolean""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_boolean.AdditionalPropertiesBoolean() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_additional_properties_class.py deleted file mode 100644 index fc9df3bbb505..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_integer.py b/samples/client/petstore/python-tornado/test/test_additional_properties_integer.py deleted file mode 100644 index 774c367b2109..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_integer.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesInteger(unittest.TestCase): - """AdditionalPropertiesInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesInteger(self): - """Test AdditionalPropertiesInteger""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_integer.AdditionalPropertiesInteger() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_number.py b/samples/client/petstore/python-tornado/test/test_additional_properties_number.py deleted file mode 100644 index 0d370e781b36..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_number.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesNumber(unittest.TestCase): - """AdditionalPropertiesNumber unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesNumber(self): - """Test AdditionalPropertiesNumber""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_number.AdditionalPropertiesNumber() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_object.py b/samples/client/petstore/python-tornado/test/test_additional_properties_object.py deleted file mode 100644 index 6e718b28cdef..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesObject(unittest.TestCase): - """AdditionalPropertiesObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesObject(self): - """Test AdditionalPropertiesObject""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_string.py b/samples/client/petstore/python-tornado/test/test_additional_properties_string.py deleted file mode 100644 index a46cb3e256dc..000000000000 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_string.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesString(unittest.TestCase): - """AdditionalPropertiesString unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesString(self): - """Test AdditionalPropertiesString""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_string.AdditionalPropertiesString() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_animal.py b/samples/client/petstore/python-tornado/test/test_animal.py deleted file mode 100644 index 179f1fbd0e52..000000000000 --- a/samples/client/petstore/python-tornado/test/test_animal.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.animal.Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_another_fake_api.py b/samples/client/petstore/python-tornado/test/test_another_fake_api.py deleted file mode 100644 index 4b80dc4eda52..000000000000 --- a/samples/client/petstore/python-tornado/test/test_another_fake_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_test_special_tags(self): - """Test case for test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_api_response.py b/samples/client/petstore/python-tornado/test/test_api_response.py deleted file mode 100644 index 5031b458a0db..000000000000 --- a/samples/client/petstore/python-tornado/test/test_api_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py deleted file mode 100644 index a02233045421..000000000000 --- a/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_number_only.py deleted file mode 100644 index 1a928bf7d2e0..000000000000 --- a/samples/client/petstore/python-tornado/test/test_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_test.py b/samples/client/petstore/python-tornado/test/test_array_test.py deleted file mode 100644 index c56b77b77ee3..000000000000 --- a/samples/client/petstore/python-tornado/test/test_array_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_big_cat.py b/samples/client/petstore/python-tornado/test/test_big_cat.py deleted file mode 100644 index be428433ad4f..000000000000 --- a/samples/client/petstore/python-tornado/test/test_big_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat import BigCat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCat(unittest.TestCase): - """BigCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCat(self): - """Test BigCat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat.BigCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_big_cat_all_of.py b/samples/client/petstore/python-tornado/test/test_big_cat_all_of.py deleted file mode 100644 index c0e71dbfcde6..000000000000 --- a/samples/client/petstore/python-tornado/test/test_big_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.big_cat_all_of import BigCatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestBigCatAllOf(unittest.TestCase): - """BigCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBigCatAllOf(self): - """Test BigCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.big_cat_all_of.BigCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_capitalization.py b/samples/client/petstore/python-tornado/test/test_capitalization.py deleted file mode 100644 index 2ae7725b3f09..000000000000 --- a/samples/client/petstore/python-tornado/test/test_capitalization.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_cat.py b/samples/client/petstore/python-tornado/test/test_cat.py deleted file mode 100644 index 5ebd7908d2db..000000000000 --- a/samples/client/petstore/python-tornado/test/test_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat.Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_cat_all_of.py b/samples/client/petstore/python-tornado/test/test_cat_all_of.py deleted file mode 100644 index 531443380c6e..000000000000 --- a/samples/client/petstore/python-tornado/test/test_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_category.py b/samples/client/petstore/python-tornado/test/test_category.py deleted file mode 100644 index 6a592521281e..000000000000 --- a/samples/client/petstore/python-tornado/test/test_category.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.category.Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_class_model.py b/samples/client/petstore/python-tornado/test/test_class_model.py deleted file mode 100644 index 12b7fb99402e..000000000000 --- a/samples/client/petstore/python-tornado/test/test_class_model.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_client.py b/samples/client/petstore/python-tornado/test/test_client.py deleted file mode 100644 index 9e18c4310d96..000000000000 --- a/samples/client/petstore/python-tornado/test/test_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.client.Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_dog.py b/samples/client/petstore/python-tornado/test/test_dog.py deleted file mode 100644 index dc151f998ddd..000000000000 --- a/samples/client/petstore/python-tornado/test/test_dog.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog import Dog # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog.Dog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_dog_all_of.py b/samples/client/petstore/python-tornado/test/test_dog_all_of.py deleted file mode 100644 index 3d79f2888c96..000000000000 --- a/samples/client/petstore/python-tornado/test/test_dog_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_arrays.py b/samples/client/petstore/python-tornado/test/test_enum_arrays.py deleted file mode 100644 index be572508ef22..000000000000 --- a/samples/client/petstore/python-tornado/test/test_enum_arrays.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_class.py b/samples/client/petstore/python-tornado/test/test_enum_class.py deleted file mode 100644 index 57eb14558a7d..000000000000 --- a/samples/client/petstore/python-tornado/test/test_enum_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_test.py b/samples/client/petstore/python-tornado/test/test_enum_test.py deleted file mode 100644 index ecd43afc709d..000000000000 --- a/samples/client/petstore/python-tornado/test/test_enum_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_fake_api.py b/samples/client/petstore/python-tornado/test/test_fake_api.py deleted file mode 100644 index fc2cbef35f1c..000000000000 --- a/samples/client/petstore/python-tornado/test/test_fake_api.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize - - """ - pass - - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize - - """ - pass - - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize - - """ - pass - - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index 87cac0b9ef85..000000000000 --- a/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_file.py b/samples/client/petstore/python-tornado/test/test_file.py deleted file mode 100644 index cc32edb7b523..000000000000 --- a/samples/client/petstore/python-tornado/test/test_file.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file.File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_file_schema_test_class.py b/samples/client/petstore/python-tornado/test/test_file_schema_test_class.py deleted file mode 100644 index 91e1b6a1c745..000000000000 --- a/samples/client/petstore/python-tornado/test/test_file_schema_test_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_format_test.py b/samples/client/petstore/python-tornado/test/test_format_test.py deleted file mode 100644 index 46707c77b708..000000000000 --- a/samples/client/petstore/python-tornado/test/test_format_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFormatTest(self): - """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_has_only_read_only.py b/samples/client/petstore/python-tornado/test/test_has_only_read_only.py deleted file mode 100644 index 2dc052a328a0..000000000000 --- a/samples/client/petstore/python-tornado/test/test_has_only_read_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_list.py b/samples/client/petstore/python-tornado/test/test_list.py deleted file mode 100644 index a538a6b1ad36..000000000000 --- a/samples/client/petstore/python-tornado/test/test_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.list.List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_map_test.py b/samples/client/petstore/python-tornado/test/test_map_test.py deleted file mode 100644 index 0ba6481903e6..000000000000 --- a/samples/client/petstore/python-tornado/test/test_map_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMapTest(self): - """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 8893bdaf44ee..000000000000 --- a/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_model200_response.py b/samples/client/petstore/python-tornado/test/test_model200_response.py deleted file mode 100644 index fab761f4edba..000000000000 --- a/samples/client/petstore/python-tornado/test/test_model200_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_model_200_response.py b/samples/client/petstore/python-tornado/test/test_model_200_response.py deleted file mode 100644 index 314ee5e3dde6..000000000000 --- a/samples/client/petstore/python-tornado/test/test_model_200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model_200_response import Model_200Response # noqa: E501 -from petstore_api.rest import ApiException - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Model_200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model_200_response.Model_200Response() # noqa: E501 - if include_optional : - return Model_200Response( - name = 56, - _class = '' - ) - else : - return Model_200Response( - ) - - def testModel_200Response(self): - """Test Model_200Response""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_model_return.py b/samples/client/petstore/python-tornado/test/test_model_return.py deleted file mode 100644 index ae3f15ee6b83..000000000000 --- a/samples/client/petstore/python-tornado/test/test_model_return.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_name.py b/samples/client/petstore/python-tornado/test/test_name.py deleted file mode 100644 index d6c72563991f..000000000000 --- a/samples/client/petstore/python-tornado/test/test_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.name.Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_number_only.py b/samples/client/petstore/python-tornado/test/test_number_only.py deleted file mode 100644 index 7f6df65c8058..000000000000 --- a/samples/client/petstore/python-tornado/test/test_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_order.py b/samples/client/petstore/python-tornado/test/test_order.py deleted file mode 100644 index 3e7d517d5c79..000000000000 --- a/samples/client/petstore/python-tornado/test/test_order.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.order.Order() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_composite.py b/samples/client/petstore/python-tornado/test/test_outer_composite.py deleted file mode 100644 index dcb078cd2164..000000000000 --- a/samples/client/petstore/python-tornado/test/test_outer_composite.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_enum.py b/samples/client/petstore/python-tornado/test/test_outer_enum.py deleted file mode 100644 index 472e36e16821..000000000000 --- a/samples/client/petstore/python-tornado/test/test_outer_enum.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnum(self): - """Test OuterEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_pet.py b/samples/client/petstore/python-tornado/test/test_pet.py deleted file mode 100644 index bc5cc30fac0d..000000000000 --- a/samples/client/petstore/python-tornado/test/test_pet.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPet(self): - """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.pet.Pet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_pet_api.py b/samples/client/petstore/python-tornado/test/test_pet_api.py deleted file mode 100644 index ffd3e25c4c64..000000000000 --- a/samples/client/petstore/python-tornado/test/test_pet_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_read_only_first.py b/samples/client/petstore/python-tornado/test/test_read_only_first.py deleted file mode 100644 index 2b647b83fc89..000000000000 --- a/samples/client/petstore/python-tornado/test/test_read_only_first.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_special_model_name.py b/samples/client/petstore/python-tornado/test/test_special_model_name.py deleted file mode 100644 index 4edfec164f7d..000000000000 --- a/samples/client/petstore/python-tornado/test/test_special_model_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_store_api.py b/samples/client/petstore/python-tornado/test/test_store_api.py deleted file mode 100644 index 37bf771d13a6..000000000000 --- a/samples/client/petstore/python-tornado/test/test_store_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_tag.py b/samples/client/petstore/python-tornado/test/test_tag.py deleted file mode 100644 index 2c3c5157e718..000000000000 --- a/samples/client/petstore/python-tornado/test/test_tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.tag.Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_type_holder_default.py b/samples/client/petstore/python-tornado/test/test_type_holder_default.py deleted file mode 100644 index 1a07afa68604..000000000000 --- a/samples/client/petstore/python-tornado/test/test_type_holder_default.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderDefault(unittest.TestCase): - """TypeHolderDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderDefault(self): - """Test TypeHolderDefault""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_default.TypeHolderDefault() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_type_holder_example.py b/samples/client/petstore/python-tornado/test/test_type_holder_example.py deleted file mode 100644 index 7a2621494857..000000000000 --- a/samples/client/petstore/python-tornado/test/test_type_holder_example.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTypeHolderExample(unittest.TestCase): - """TypeHolderExample unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTypeHolderExample(self): - """Test TypeHolderExample""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_user.py b/samples/client/petstore/python-tornado/test/test_user.py deleted file mode 100644 index ad9386b6908e..000000000000 --- a/samples/client/petstore/python-tornado/test/test_user.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.user.User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_user_api.py b/samples/client/petstore/python-tornado/test/test_user_api.py deleted file mode 100644 index 6e8aed4f18c7..000000000000 --- a/samples/client/petstore/python-tornado/test/test_user_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_xml_item.py b/samples/client/petstore/python-tornado/test/test_xml_item.py deleted file mode 100644 index 121f1ccb6623..000000000000 --- a/samples/client/petstore/python-tornado/test/test_xml_item.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.xml_item import XmlItem # noqa: E501 -from petstore_api.rest import ApiException - - -class TestXmlItem(unittest.TestCase): - """XmlItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testXmlItem(self): - """Test XmlItem""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.xml_item.XmlItem() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python-tornado/test_python2_and_3.sh b/samples/client/petstore/python-tornado/test_python2_and_3.sh deleted file mode 100755 index ef758bd4450a..000000000000 --- a/samples/client/petstore/python-tornado/test_python2_and_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/client/petstore/python-tornado/testfiles/foo.png b/samples/client/petstore/python-tornado/testfiles/foo.png deleted file mode 100644 index a9b12cf5927ac757b054dd875ee137c2581f69bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z005plNklH1~87DdzFiA2XC;)~Dpo$3~298uzpt7UB?2C zrfPXaKqE40ylK3PysV@&`KFt0-oA3>N*fHwwj}%@A;B=D*V-^3rG!ZW76I^B9@-KC zfcx*if9)N2+};ZUfyS`GYGUP72QH^lJR<@ck#YP(vYDU1^7d=5z4ouR`v4F@Nabc& zLb)YG`lepJdcUe)d-l2K zyx+EMn+;9f>WF|wWYl=$JooJLs~>;-@g90(3kED$Fc@GP91I35VIa{AEG{nY zvw8F8{&{(Mcg&voQcL&x*|~mgF?k;cfR2d?c;u0XX7umh|K6qw9ud%pj2d_(Fkkrl z^Q#~K)3hGaAP9>gNm&_?3=;$k765@>@hSL4`-^bt>E}Z6H3S6PF%3arOT{xPiShm6 zaxDJ-3;f^iRX9|27?PB=Az0cLiU1Kio9=(PpI&~}St%btePp1vO#Y+2CJ+e36c-ow z&igcf^8ESphpk+>(vvzC9(RfzfDl4>fP?Mdh4VZjMxQ=?@Y-vywQ1HodVd5oBIA^^ zFc$o0{(`%wOdh5;vMIIOAz^?JV2PCI({a~1SD@c%=Q-O+LO>I}064#sRB;W90D~nC z1diaTZ~u!W`@d9i4~rm70kQ(H1R$V-r(^)1e){R~xW99MoJK8et3pD86hIgP!cuE2 zKw1>0Krj!2pkXD zN`p!8YmOYQIAhVG#V^j7F=NEeojV=tKz%-WTnrHe3^M%2asWp7z(xoa!_mMqWY}Q5 z@WOLZP03Y>fJS6gd+L6-_xm2_pMU;s6QUk=Pew6SD!BD)K3<5G%vs zW(dGyhG_$b*Vor%uQKZ(#&3EJo6C2BC`tuPL10!XU6PE15$%lxEZWaYWH42V~ z%W51sawPu46(2nC!V5DeuUfUr0|vqe6yahO!71WUOT=$!_^lEzkVw4#`s-7&`ex2( zDrwpXXhcR>5|ULVTV`ct9Vp(p8wN`N0u~s8C0H;7n|R>dff#&d5BszgAjyyhfye?| zYQuzl7P)~zA_7|h`vew{U=RzGR~^8_jq|YOz#g^Pm=O>vK0-vWq{Oh{Lr&;~mQtD< z3pb7U```aQck$xIA)8(O?s859!zQC~h}EG3!l5onD0uj-5)tzFj^gdjP1CGs3hPBg zwoGIYQNZul!~D%}esf^w&Yd8@zhMM{Nnl``R9w@x2ZZ*~*#ZkvR)Hm8k{Jw4%Ds_* z$;x%nd=55+a{@C-w2E$p7t_Yzyp|mh04W{_)JaW}5k&$^-dv1j%iet=9QcJBrKP3G zul;AAe59n;S34~t9~ zEFtZ)M?n3~5bAM~AwIo!RWy%-1cL(r1VNGnlYn7akOrf)GJxAQ&c()qdl3bxh+xv? zaY%!)Y15{}xVTn3!@D6c3)dBnm^yXpTpiH#S_q-mffd$D2+fFub3>?FYa?6$H8k5| zVdw7RsG0_FBcKr(jRr8Ps;XKhCwDra;|SXI(3ZxzE!tvE>Wye+Hiv+O1rubSqJm)u zHPtID5FKFRN=ia@b~e(|(~y#! zgcdDZf{1YF;32GDy&A8)@(<+Z=K6xDLb%4hBDVp{-p#q8d-v|IHFlM2|6Oo1IyP(V1Ssp;!)20KQ?e5i*8j_nrMUbJow|Mb<(Fq%ef3rM zT5Or~=FR)pZ>Rijgg5(9jZ0RIWf080a9^L4l!UCl*|_40ez>StFLdb8p~m0ir8%$Q zfj>@lVkTY?)1R4<(Hn~vzd;fAq?Uk#nayq6wq3mR?VM-+^rt`d(B|T?qTEA=4n?=L z)U~~O^_r8GmiA_ReC&>s1*}um%GkDT$Hm#1SsxoP5CB6EIjm121AjelIQpJ`E+7mD zutOKG+iO#F^S^BSFXrzoK!AkJ>|)2lVP;I6I1#gE&GN(&T+j=(7*K6MGI;%DW@h4+ zTW-e1mt2gvxY(2WE+a>b#;2ctis0;tdmR#+wros{i;LSC0gdAX4c|s)m|MTy*6;f3 zuYb3=xHtqLye40GlQMK63>h*6Lx&EX(Y0&Ww-b{S@(jZWoNDFEHJ^Bx_Q8kD-kDWJ zMQXhoAV&{_h;i}hoiU@!wTgd1isBhulvWqRkN^vbl0X&4teb;f6+bH1#dc4ES)=Nn zxhJ`l0hO7N(#_Z~g#`-zGc7F*lP6EY)%~xA5ViLmD=VweDdns%*I+}K0G@pEi8pV! zam?^Y%Jl@nLrQ7Re{I3sDO0A52uGChnvT_59De$4xZqS`Vj_O^t6#0XX2{@QCnY7U zG7O^vKb65S8C;c@SAY@Mj)Y0-gbuI-3;>c4XT;#0UgOcqXaxg=Dg+>4_}HFxJ_KQP z$u>;b@NeiWiw3UHf;aNT4lK*EfdeoM!}(jE^hAWDq$CU)GzjG3o9p zm^W{p&l>W&DoII6$X}Tk6^UsaCt&E**~1S$R6cw5oEUdv4IigJ=(W}OtRmqCJCGW%pz6&LRUNwtwIgJ4){{-&Nc2*b}z zM*!rcO9O@kaouO^m3yRsKrk@*s|EPryUk!hFkslOQ>gV2?1F@&cmqIob|$7x`xCl! z?OZR@U0GR)PAO*xU9@#n@B(vg8SW4%UnK3K<2K0_Q%PAOROTvIr z=K)aX8ttMsB7(&X3Bp6)yp5%M*MkN7;uqfHF@MZU-RIV=TVu+UDY*HTn;dthA;y+1 zU*WP#`*|ql{+P^=Aw%%O%;y_z7NyapT$$M%KK#0>mHDfJHoOcIyC5gJUcH8aKy}|S zT$N(@*h#3_n~{-$M<0FkhOVhy-aJ|$wJ`%mWo2c{yYHM-viPkfh^it~MiC54Sz{Im zL))d{(Q}5O3IUjGC}yZ&+sZKNOs=Axs0DCkz+^(1aj)pPvAZ~a)8lHsA7pI zC>Mi+NMKrjLogtSA&Fr~VFLo8W3xC6I`e$I_5C{KMhSwDminon0|ZsJf9tPr!yoRu zuU;}e$20o(?~i%&<~cs1TgRf-;J$tPQroo)FRmQ1G~j0=rX+Pb;GXnWSnEJ9?vW!$ z;?~TPKKR}5?wOLAo%Od9(Q=SdngNFEl8!k%lY-#Iv!Rzzy%FfRI zTLd(Yv2h-L@R0*EXU=RH4m8v$ul^n|U;tit@wpRP5S5jc`2346F?a53$on)GMMXtn z!5|#ZBm71TP3a~kCSua0NpFrCHR>0_q$5NWkW!jL2pPdY=Q(z4S26oO!(gmt6^ z3BZ5?UP%Bf2{sk5=!}U1#eg%{x^D^~F|Kef)|72iKxw}}vy$~%yQvVZ1U?b+UHhQ zR^q*P-^UwoEJ99BPDort|6LsyAUI|c3?NU({Rzv3&XR zX|rd~j`3O!p#bDh$5pTCV1xy3H|OWp#QTo40(0 z7oUF-IXO8fD=Tw0qBmx8H2no{;I{h0C?l-35Z;~e6WBsCMFK|?wylYKB3L+?2quZ& zcKSJf(XNj}A3r%u(jyj31h7DrZE5JaGoa|`OwzFylq;gZK}b_oz}oL&*_s>z2Kudf z8l`~>pExlDAuB5juP>b6s6k`eV~^vxXP@(}3&;9n#@6lIS~qJJRT=?}Fr%WPGXCsN zXO#r&E^3!VFS<>eH=Z>A|9D1Tem-W;d9SD^q0BN7_04_Q0T*R5pR2fw*00xr;Sh*rE?D!uR?EVa8 z)*%FlVY1=0JqQSi1A#;Mc>h=U=*O=yWBY$`ea8!MTgOY$(uh$ed_cLbV2RSe0en)j z6(8^W1||~%WI-CLX%n*mguwI9zvuyVMtpocva+%;e&Tp!^y$;!>DRM5b*g49DB#$< zdGj@m5i}ay(vVV`NeRhS-XKu0sTLa>i;bHK8%5e|_ny7@;~)NrWy_ZNz%5j(L4*WS zL*10>>CeX^r-jR&c*SCBYISH9sQ&$-^M+zj+f)#Hee9FW6dc@zsoyNc*N65w!A?(~ zM%6ckExVngzjQoSMB}Nh*CC@-3Ic}2t|R4`wfz%(T(TJ@fl845dTpJm=1r`$JQzXU z>izROYSbwF`7e*7S;J*m_9t{qIm1gP^isUT>73s3*kaOM4>0=!4h z=4kgwAR{Bg7gQvMPYfm)q?xPmPS4+v4R;7W?j(Cg63}RTUh!$H8?Zw1( zb5Uj;h5-|j7$ohWD+E{qAl0Ew3PV{6f&eQ37^+9CfQet9bt$$V*pD~9UkhP#OQbL$ zZ7R72IX}osUs_xTO9O`L0;d6U^ytx;KI5r6u{@-d*t>6^Q`o1oJTWbr?>|ye@kY-J zdX4v5hgzA;0wXCY2?eWi=_d&q!NB4D{kDm>^O7Y?>-EX!50Cwi$*nv=`wk7OChYZbh;9P z1p;I_>fc9QK=uYEX0V6`qYA`8nRNtXzIYjXj+B5{C@^3NDHzO3do*B3m{PTIguPMJ zdszSrFqx`tqivb!ir3(5QWOc5m9dX=gO!CAAj^rH=rVq3GhBtGl+&GlB(~LY>m9e_ zfj|D?m{#WUci+RJMQ9~`M$?V>Pi+c5TL5&Dx1wcf2vfBt;cKUf>CPnZj zvqpLudNUg!SRw$TC`|wQUHoU?Drb{ww@uZO7zh9u+O`|o$DEGDW^veAQHGsI%J9+t zEjVNyR)-3!7LFDPz&@ds-iHN2ges8J;viVo&o86kj|sWu_Uu>z(grRAgv`u7nE%Fn zA7EBiR^rL0ren#QOHfo)6iU7$Wx*)RMpfi0H_dS7NPrL^d!C%Wx2`ToxIQqFB!&zb zf~WubOzUtm4X0%GB=}2ufB*QyPwop2;CWBx)YQ}_1sM9;$B(-OWXxEqy1)o@d+YVTK`8cB6O8B(*45H8!eQ<-2k> zB!DPpSdy^&NGblaZ?&y94oGR)B`XACfeT}k@Zfm^(6L!-0K$oZ2uPH4x(rWmU4bQg z*8!%0B?++O5rPZ^m|++utbhe!5L$_5xb%#3aph^}qD#y6Xd4r+tP3d}>txfx-PnA1 zFV>W9$A5qP1_!MQ8)(Q0oT{h~BLIQ?+yYFR@>@JT{YhDnzfwH))O6(K^GZiTI6c9onE~+K&Nx1|=&+Ji+bg<3u(5EA->njZ$!qR<(n6)b(rBw$YSU?b? z5)x4mkR+5u094hir0N;FN^?X4LN&# zJ9gM{09)8bS|CFpwM9D++nEcNFvC#Yt2=inAR)+Y)V$@;UNp1QtChrvvfpQ7LKb4p zSk?3h5{C3!GJB5vh=;#^4~zgz))@r_0FoqHi{|*_c>{698C{g#CkPA+mI1qb-ph^w zBnT!HxlB>gl~}SA2I8Yy;GRyGq2C$Fn6mLLlv#&7@ew=bAq>D)izAzXs@5_fgq^M? z!<`C?%Pn1P);cVg0{N#8&JV#76!t~byK{(|e*ufNXCD8Lrf(I{>qHN9J8 zhu3xxbk}Z=UWS0Q{cRB-ToB(0x(-FxdDJA8tN0bFbs|Gz^^e6$K9K@SB8LIX=5X|B zmF%PyEwH1@!K5sLsb9a1vOp;Wn=0iB3&PHR#G5VfV%iPp+@d`s08=n5Ettfx30|S< zpfX7OLjePvu5cH{or78FH{!PS|G^LPAcP>rJMmOiyG^5%Yorgi#OT(zF#at3tj*cz z(d`J<8RBho9k&4l%9KA*QwcSBfG9CaCM&b)*b$eOHLrcCSK-JOopcotgzK zm0rT)#c$#FzyJNk$!8^hLa6_~J`G}NFtfRN^X4I5p1of|TA+Xb{*hf?%cHEU+@4>h z$W3;e!+;Q*nU527_i?((k4yaO&$w_lp;>sTZ0R-5BX#rA52qxTp_uVTRsfheTBnk<>;I79+~mz%bZmrIPD*SVFlS0Vy%3C{Ky< zDAa;9Y*|4DZcoU@g|TNTp=kT`H`%DA4WRbjd96BP(%JpgBc2qffQ0~Aut?yk&cm?y zqT4a~tSfPDtM)bl&O|^8r9%SOa$=G-`+U!R(4x)Egf7k7;pr~J5N9?AJZWK_y3Q|H zh0@Z}WbeK@GQ8QvBJ;Z&yd&1&DiePox{@{rPU=Gl2n7--)t7EvVZU?OVln&?ws z_ev2$C`}8tocFLu*y>smTMv8(iy4MZt`Z;!0AC&c4*BIfRCd8oj9_6Yle}}Q_86O- zrQ#))1vZ3gG;I^MYGVsn%wRGwNOzx;PF1oBnCjFpv(iJY!TwMTR@PP@1JV`C9(G0=;-X^QEDhYO*5Wr7 zPyR``Cjej=M)&GYvJ=sSh>V(zwQJXg5a8{i{XoNGHDh^ll31xcTLjL(CGL5{{0sOTNGXwB{J$Q&g8fxY;zcN@stGD7>EecF6kyP0oRIC+rsfypCqyYnjO^0@2Lg4}wA1Q;yjMYCDIq?8V02_*_N`i64Y3Hf72c$Nwu+4a_ z049xE5DAh2dy^{g6AWB-+PR2}ic#rj2@r(+{TQ1M?SZgm1^@|*$suP2q?^hOw%n=( zEs}~!YlBCnDQ)m2N3FfN8Dn?pRv=`s(m}Od{rKYv4b;Xk>v@p|Y(#G3i(iwfgNt}p ztHdU{#ka1<<14KGlDoSGG7 zS?I4O06-ABv}kA7_^bCM7`A07K}6Q^Souv3G&K4drV+<>!BDtpeI%w)HzPSY8M(Q+ zHYHgH;grG^NZA%{Nw+OVQG?nO!NS(FumhNaFs5BktoUIwzCQH5;&NCLWT=x{2SWe% z{Wl)vE%lfo0Tu$Co1fv4RIFQT3jl;=yJVIU0lMI{WUMaVsld=uaTI0?#g#u|){g%v znM5cO*m=#{;>N^Y7;;8;FruNFGgyjFev-z#rmI^*2|*eRB>^A^hSf0ZNYp1-c+jua z(Ha0<*z3Z`4zGjJty@=h(}nQ4CnbDD#TYEL7^N1>sbQcoKyHNtCp+I*^E?777pp5^TbwyCJ|r zxk?5M2x;NlLwoSZ=A{_3_El^-xZ84?LQ_#2Pk}Bi z+hbPx4QL@uuyF5j6#*azh5%c3z*6%! zoblj#3%2Rr+$rak6e za0@y&Z|l5Y6a(OZ!@Pv0$Xd!haLIo4(b-*-u!1v6jzpi0U{dHtO?J6HNq{6wsLgA@ zKmdf&z#&ZBFdv%_?gr@OgDym@=;L5Sk&3Taw%4eLaAegd8?-?{gNOpsk^x6Zl_-SZ zrJ0M7QM;pk`}U#2#ZoaGzdf)|=|Ttrk`@GN$hfoxdUgNRfNh;b!`*=Go1KP#pFb84 zpECsQo5!OH0RYO(Hv+2rnldcd(aSXL3`w1@N9i731_`^W7T6jnRW&6x<5Nh>(HfOd zO`l-PA_7vyZCI(2l~*0aL*Fc|oj5J&Iu`ZQgeL|h3DMEf2kN`pwL!>T3_cvJqv34` zw0!xyksV$~LBFJ=BwqkfX>tmD@WWnR=oqlAhv94nl1ihrKC)=Gh>nW61ng{)!2XI7NV{1z zNrq+E!-@zv6`;l ztXZ>zr+gq309v$YQ4-EK)+sMm7Nu1ciZ4KnDo90XK9o!~vmw;$#AixF)CM<$e!}C(n zC$+hM9Kj?hQ~=vH(D?ZHZ@oU7TXSN9nNVC@97(&@(YW>YTcHJxwaS$= z)M+|z?8oXN=bf;o^c%bA z&nDm5KtEx^Efq)GXQxykl!(6Zo^(3sr8FMYqT91)Ph^MJ!RXTYJjBPxyRi+DYGVt= ze|E3NkAXvq)MXb)DIeY|qo+(}#msb1YRzaA?AZ)<^%d&=8L!toyBS1ujdeVY>km}!;Eq^bv!|P~_88gP=MUdUP&|-;l zs{#*y^RCj?ly;YQNY%y6(D%!7^f*<4l}jJDgd5lWx>?OY?w~AM~fuS-MtzXEEpgJK(K^#dc*XNO?IBg zLc)+htZ0s2t&&tr0&;_^78vUf@3uKCyyN??@s>wG{c31!wn?5-$-H*ug_Fm&qF z>623)G(4u$hK!7iYJ+tEF!$g8iR|t=8u$MGcfN%yp~P}XTKMFLukg-yg-Rd?0+vnf z*PID5ge#B>Hz)@H7ORZ~OFA1tse&tT@q&<|OsjwI5tj%9q$t$V_Sa$IgOaaME)OX% zl6EUa-K*9xo$B0^wlqiuG)XcJScmZ84_`T13xln2&skei3^r^%4Uhf|133HKbKXB?LBkuI zv41ZdHELv4aG=Kv9EF92kTMe2sEZLD9fezOz16Yw45@eIf5iww{E@tlm(5DW=TXv zS=m_|l__g@OfPoa6=p`x(wxW+ucPtDseeFR>v%AP6CW^jX_&C^(B>Tc->%h)k6)j$NRrhKurGcoSc}1 zW>L`xPf5_IE(Mg7l=y}hAp8U`wO}53r1OjQa-sM z1(+C5Z~ZUEZFmi<4r~K)mCB$9R^?da61sGSsJ1X5RnwqK!78gF2~~!~rbD|hyXX^) zUjGl=_~k43&+a^w1rFNl#I0ntOnXh(r|N@WFU6KayCJ0I$OjrMYb_;fFmS*+gehAV z+106v=&Iv2BrQx#xfl|*FpsU`t~c<1cCSJ4ky1sB3rJYPRY&g~mtwmb9MHGJKLTKhDy%O578BRa#rTa2 z@YZ+hvFmUtm;_8q!09gUQ5I)bje)8l@zsIv@y>Va@aR|XVEC#RasAp?@j~&(*m7VG zED#K7!pX{z0l~uQccOGc0}w1wW*x$W4X-Snh!Btx1_5hIcH*gRE0nSrTaZzJuv7+x7`XKGb9^1s*e>f= zfFpdsr-R3enJV$|_uqnT?u&X)m)<{U@HM~Y2B=b3*V%x4h+A*Hm6yEvPSB%nO9N&? zQc?n@PW>Z(``h24w6xUs%-e3e4O1VuKeGEza@>8_WGq;)z|&rleLlAiIRUN|D2fs&&JdAG+d{=G3Tewz)%Cx7Dbzs0ifGijiXl1s* ztaRP`L`eWj4P4Svly7!Bx9fO=fJBu5qAfU5e6X#huMh3ULtEalc_D1OW3VeqZJ}Ql z00_O~k};q|8WN)7Q7RAPlkdL8;_ugjpF=t5*+TKIq9`H6soBf*XpL$M^7EHmJAA}oM{L$UVcZm~ON8;N zmTTdj#Kc4ttjvq-`dS#1?w*2q^X54l%Axo}k%@GNbxE#}kA990_7N-B!jMYy!L&=w zz4tRX;LWa>jIZUPPE+a*>tM?cvKp9@aw%?1=mVBf@DZh0cdl0(%LKWg0yiE&cI;s8 z&NZ01^AnU=6*f;qHGZ@N04o3~44X)$;w|p=s`ilTx)=r+0b;wKn?w{dm<1O1o`8g? z(~q$~EG1`10?|^U%2ZjRHKp4yzHlzI9FKRd{_uxCto`+!cbwl)Yo)>56971`bLWQ@ zAOynud$uN`w>Cw`JD3^C$;px3UQ6TYXQpHJ>{-xq`dVGvwAqaem1;FWcE3~gJk=yw zJzw`KVOB8>uiF{ydU`j3e%|QOqp@Pee=%s#Ap4MDSg5j1c-8aNf`u7dS76lVuVQuC zw+>@e0gvjJBBVO;Ez&(*0n1_#RCoI?%8D>?{l76|$Ga%w!wzU!Hd~e10-M4COQqi_ zz-)jh%I-p^tQ!M1<(`$$ux|1^>8yUo1PmQq_O?`_fC9A_Jrr~=paQ@(Lk9o4LE~W! z;ht#ggPF~Q4vAGlxQb5xQ^y4ejkubb$82HNteLoG@SwQF`tnBPl5fQ>XqBgRU9qi*NP6dLY)VQ)yq#NY$>B zCU;o^NQgcIV>{gJ{p}T9v zbSM2R6h&TGD#h$|wbXhIIIS0>U?RW)J4h+e|IBnedhS36T#n_Q=<{3Hm8@&Zw`1J; z|MQ*g`ZJS~l90bLFG}y9hUn*7FQ5_b%jw6S|N9H;{`99mrF-2D*Yx$|{e6|N0i>j) zATR&Zh@NO2jr_a<+;!L8o;n~;I|Ar>38gXW^eh!>GwbxN-Obh0(Mt{L z@A^%({cV^TS6?*%8`f=r6sj~`7iqIcCjW2}aqJH+{c9=o| zfp()n288WyX|6;SDglZ@TJ!ek5EF-we)tN2RIUfRaW+6vx&^t}4gqBqkLi$sdpcd| znhnROA5-9^0-uHys4^rbuA7V1<=YU&Y7Sj@knz-0PrZ4=jn@x9mg|2?#WaHd-nw;r zzn^9IU7`NX&({d{pp?I>2rjEve}?uQ+C_GE9gp3+_uz@YJc;Ew%j`h3@b}%drSddO zk^))*Ov}*;#KyKn-@bh@?Al?t?9xjR8yj2GwS&o%euvjyd(AfEEmt(h7Vxp`^d!iz z;|pq|McFMP?MhG;oU|)dO}j;;zHXBZ#Zom0y<4W>$!^yo)@+6ke)tMcZhH^kR~%6F zF0kD$Nw5sJBG&>VG5R!2I_GlqYkjU#?UEMYp^qOera^YIX;TQS*uMpnHoxJxJp%q7 z$J>jxH8%_+&`=%Y>lHMr0}p046FVkVc~3L9B9QEp%JKons8OTv^fS{VJG$OomvU?< z+<^Q~^H5k=h#$*J9bSeqpH%>}`vvEtWs4RVG-x2sKC2U=qoYsibLYJD3jXrclQ>j* zP!)pNG-`&WHax)>AJH2*N_BFwCHgE!Do+#8ba9xnBm{0tz8K>YG7!bls3eIfsD85_ zezzGP{`eI>E8l@#6(!DL7Hc*`ued~9envM8XqyH@3K*oi+1m{fj``iBt;Noyqyq-8 znS_wH|Ni&q*E~M$v7TN_!;NM5M_gPS zHf}16xFtWaaip>mH{S3I^9}sp1&wy=U#r#q1p) zD`qS!>O4GPSX^A(T$ohR(D$O=Y2@MlzUG>NcLi6v`T;{YLD9u;y%_wI8K|tR#JkJi!{7e)EY`1I z?@LU5bx>8`7w@G(Lb^MpJETFnk#3NdM!G>jx}>BVq`Mm_K{};FIt8TRZN9(vW}g2! zbBA;9Is5Fr)~A+y=vUndDj^{fK-#>1B?WC92zuyE5g~g`aS7_gTK)jYQBG-L-8+VU zT{xY5m{H@lOGA8yIn&bQ#I#ygNeI?lXDI8>NV~j@5va-JsY)S%@43tIQdrYxPkQ9! zrtcFHUbl%+5kTVy{Ft*_qvYpjs5PbRBg2b}>hS(&ygy|gH`Tk^aevm2XOtryOB#4{ zvp@#K4^cqJZCURyk0ufPva{OTv$*tpvmdq!V!HxH2gjXTHX#M=OtcD2xmT)kZO72z zrfxZE>}1HHCT}Xkn0*R}=-D|fPVcZ;Pi}@xH5ge?h-i&3q}+~I3E;%nt?s{fN_9BR z_vsMcjdXPyZ*8aLRLiUO!@|$iym3wTeez}JQkr)0lmkG=|A5P75``qD%M2jS?_D)+4Ltn-%%yzK) zvuHxbm>twYD^=W^GX7wjP7fr6Qna>FHCZ0lHI~ID?_LYwH=Eq#CG3YUnHRORS$c_{IkVtj&3X;W!{-|KO9L8#3SF^o$1N$wkRq*um zL@XS1U@BO5O?~QTYQfB3mF4B%S!ha`B}q$Fv~ej5-dZMo=TujCCnrkyGst7NO}xF~ zS{}#0I$h-O1D`Apb0>T>1a3()e8oyubW@sT(C%>8bfm{14n4yC1J?9VQO6;?>?({4 zAR`(5Fmo`*S|?&Vu2;RMmm{S7r>T#5I_}2(B{V(EW`^;7esK?tJrSVjz(vBMl>Ek$ zEfxCHXY|Kdb5c&*EySifo>yJSWP#sJ{oQYxQ%vYM_@AX{05|us6|5iOF;xE^yc2|| zr$&{!Ff^*&;!N|R6J4K^`n+#l9g-RqRo>U%FW_^Iyr9odDc)4C-u}G$cjzD{svatvZ_6Cb}FJs!bMv(djb; zrn9T~abG!JgM`4<4r#0JwFu&dC*N<<>a&0DA70_4nkEg47RoIx1mqWIO? zvKk+|jo&}YBSHyw?V2uEKWQ8Z{>?w2p@Lh_#YSh}+%k<%T~O5_e;=xkg<%35LVPNI z)g+v}h{iMNg%~l*+&+5^`YP271*Nk*2NSKXHnt1R!nLJT`G!(rJq-E+54x{ehbk;F z+-xZzfw`7$gQ+nc6D^W@dPKAKX?Aekp_BnF9Y*-_ovc5~kF#@{|4KvT!pkEFLRIup ztZn=NJhU~^kWIzF@M@*CD7U?RS*?5jPgJ+ozSqw-IzqO8$M?bwySI4QrLyr^>DzNz z3eB#Rq(1Ah@w3DPsL;eQ^kbExuQPgO16eBg*K4Q8#7;HoEW0tFr(kOsS=NX#|Z*Hnzoo1vM_RM@&^Nk5WcjQNh7M&a; z`Gwk7!bbyGJKh(C<+JnedTXKfb7b=vf*9o{CpD7>U1VT=b>&|5J?*l2UaPV{*r<)y zfn&5wrd|AVIhFjN_Gq*ms;Y|?UvO|PF3w-2rC5CoKUSW&dF-AXtPXv>pBcWn zY0!BS!BD57x4&||M)WN!tF@Y9r)0I3jz6mh<)UVg^l+mCR;xgAAGx5YND4y5L1?Cb zb-}2~?6Y;%Hgl&&jMlKi+<#;Sqo5iSS8XzKFKe>Up&N|V46E_Bm25Qm_X7{2L?C;~ zGla>Xm#*BU`{sNrhlX-Sm?P&q5`^vQNrc6!z-yum^iZ>$wtZQ&;c?R*p)QnHGYe z`sVm(>SLn&KGhj@XQWta%IgyI`q?%h&|y%Bh>*Sb6^faxtQY~}JuZBI6lARN(IJ>m zSeVrJ?lOjHWyq=|9&O!SJgjWh!xu{U!3qu&3oDaP8b?QNE2EG~T%YC$SKdu1eCi0@ z4ZH8Fa8lIMV^uHSVORIMP37A;ibyD!N;kjPmBX0g>)-`>=%Xi?K8q10NB^3U>deK_c2^3e-R8zz zKNoc}QG#T$W`AGms-U2-Pj6$r%yaH$SZgMW4`pI*{bOL@!}Jbnd=deHq6Hi0zoW%` z#n+H-g5vC$y}i8#NEY;D*Ad+lL3hXC{gXr26&kHl`>Y>wQ*8N@_ZVZH1-Pv7PkIDG z{-XE=_V04Jh1MeWx9I$vX%YkUJZ{h)uo89M?a-oKSPKF&d#PrF?4#sOq(ehLf8hKf9d{!dWUqa^zFS;>~dhihu9H8e<0F(%r#t(MBPs+s!~~ zt@{Q{W_7L=vAGJ6AV8>3wBffnA@j+?!a~A|jzekIX>Pc^c|Jslq}p+dfJJcw=z&{V zm&H~Jn4`gCR#Q<~-?M<#Ba{dZgh7x>)&$3GD!>V&FE3r_8i;IjyY3FkgnD%dT+Quf zV64JKRaI3rtFwy)Vh&kF947*X4#J{_N-Xr97ip$u$244AnP=4W^`jype%=@}=2wq;B zTIT10EQ2<0hD%QIQHDqFd$eOpMoJFKE&P1t?A5l*jYH;`=~&);G$^Logbg>$@uR@q(uLuCjG&H ziUvQ6&|Z^5*F&Jvvkemy!`a#SgP`VvER>Y1<}1$h1~kGRvZ5{-$1^D^GhllLR(U~P zaO2)irM`zJwnnm$0>AFB@ULtXqzkiuwyv5He(iI5wB zTnuAmU~ty=*7zb$x*pej(t22gHF@c{5s-hRvvvVgiJ^^lOPU#;JKywJT8^d$+uV*H zfGuW5tl~m%*NYH|BtZwkzC9<`e=Orxu#!OVO)c@u?c-ozWOO<`J?R6&?I50(rc5gF znZA!66Mai+iz12cZ1%l3pTE+rWfGE+b>)wV0+ay=zhhQf3mjh0qZ&TzceFxC_}#)@ zo-hgmdFdH2S{om?x(<#1>btu-%ww%@H>8$Af51GVNOD!RG{iw{LrvI$y& z#5r+~+oVGWYwhW4HZld()&`W9-7uSkK^sj}gigE-LZjuAa&f9->UsgX% z!A7`ZNpxvC2NWhQ!XV=Uo`VXM$_>-)7SdbwUAX4hJ_H735ur!tx@1vu+lbJx@_YkZ ziSLXYerfEHa#780T;1^c(I~!~$cPlivPhJQsvdFMyMb5^7s9@PyVCCh5F(-yav2ncidrss8az>N^_=qCzp$vh1m-7Z0> zs>vLV@xrr(M6!&TM5zDK+Vf|UGB#pH5O8zu{zc1Eqp%7&~kx z6b0DgDcIRDzJFg~^EflEw^_p#a6e(___I@Ue&8C41*^dl=@lzY>S-qB6~qxHuMjRSF5WDT-))xH34|O| zzJ`Q{BejwG-E2rpMd7m>An-y8rV%Hs~%9IH{PKaaO!9MYDxFC?vk>df$gf z1w{Bl#L){-0#INQH2xJ7C4UC+vG}V%(~d?Zg52kaU6D2ZxeI#&0o+){ba?b!08oTQ zMn;zZ9V$suH8hOLHuB_lJ6hPlp93y$WZZyn7{EWLW#~%)3?GUEQ`NkjVZpIG6@GUW z;ahM~j!whXIjYlin%6xqj&hNQv%a_9|BenjeGeNWdF_6?{F*A1H+4H%4qsob*s$6j z`LsItH{)99x#({%xU2uIrB~wkGK$KQx*r)fH$M|UZhmBRurFhtG z$Yu+RK7`Cr8qa0t+eT0Nc8M*O16eEH=Z8km@F3(um>l?t z`(|M(dyTR@@>Z+pIeOdLU$OmkEC-eRR;x`_-+*F>V$aXQ-rnBajfHdx==Zu-(?!3M zTRRcIetQQoUCZhank&EEEb5QMQ~s~qh-vG>mnw6--NGXN=XzIc&$^2vg{lQtrUWNh zLjx@*KT_lP1kGgBNle6BUe)9=^nVLzA&bg;2k;b9pMOI$jeFt&lQ{=R9S5aA6VzbA z@b$W=j;G>^6`Ooihq)jwQ^x#4mu{5%crasZRcut@Rst+EhsDMN+;bYc=|C6|p?WdF zU~G%jj0cf_FcOR2`Q9dJT@?G8>>;Et-=d^2@AhUC@>O&{mS&;Oos7S}>i&0{0F=g6>oepd& zt|%#j6Zh1@!fw)z<#~-?AORJ6P1o|Wa>9b1f44C}q{%;8x(3<;<|`Gs1^Y z?X%L_Kv<8q+&X15HTiM5-CW)bfwx<`*^wf382)yPf*P60=*iyn+3Prn+3j={l$_-$ zk!ZBZVL;2}7bOVA_)GZM`t*pfUih|-ki;k- zMEwAjBL!~a^Ig)a7#m;bS+9cN1vrUWDtE!_Y`+FGf~Q@D%bLqv4P`^4qdvmI z!hV*(B<*q1|(hL)D}4Ff|E9I{!n zZeZy)EQlt;z^^`O|*m}I$Adn#WeHY_^f7)rKYk1+gK5!!nTvEnmVT(lfi-Jw(id;=lHUUni+pq;uvTV8G%iKWb5uj z^6Adb_Vx>AMzj)L8s4z3C|0(XJ|-@RBW+`@lawk9NuHaK?!pGO~Wqr z5Lx$l&p#hc>~sO7JUh_1y$zfb?QsJhA7?Mkrt_-&Ja1(v4Et6%tzo1TnNV?Vl$Dh1 zs}ETi8G*OPtM8XYsg0JLAxa;c-8%W;@hj;N?S_vyp|8oFv>^VopV(iHV~4fQJe&DS zhvI^Q?M&dvKIH{Bm6}D^4G(b;4nIKgFDN^7?mxlxcD{C#2#3jF^@&e;VP3>b7!$$K(?H`SV+4me+`m z{qF0xF=yIsy7KD$K4nd-UI?R_C>YVkI~c2dEL2o5`BKqdoSXuO4sLI9ExZVOl*=n) zP5DGhXt6-kYw#OHVOe6jg}(3XIMGq7 zbTn}wFvRx}#i1J2icvg7oyl!7@SV6{4Dc~@Mfe;YUbxbNS6JF_;x$a_Jos2)n1&}`V**$a`7 zkW`K)&i1RjgzlMMymHY8JJE#P&=gfh&8~S08cgb(cDouy zxyfpo5KV%Ic%#5)Un_KUsrsh?G;j$Cw(p6QvcTj$s8)fe-bgjml^ZN({A-#XgH5|b z7#3tfsw?$4Vd_XL0R_M44hc!N+Sg!dfi4Fm-gs1Z325@=7O6*gHE_M;`?$#o9|klH$*12l z>kCEg1DQR!aA4mi z4`mK?c=HR>qA*VuHaVcWEQ@CUju1LEE-@p_|7lHR0=#q>{w0;@owb;jg&D__S@E4{ z=K&IihO2+*flEcjhy?9>Cz4E)VtZyoa1J!`K6@K>MCHwT*WT|2dA3&{##cKQYJ3Ie zD)kU3dvgL|K+Ezt=eE6zvks8-K|Gr-SO|bZ!RbkqFBM~joj1shuelMbI3L^muN4lI zPdteDY~;po#ooOOM5KnUhBAa^qb5g!hfRf%`v-|qosW$fg3L_bOy|dL-0o(-c9PbQ z!7^QnIj+ddi~2lhbE`Et$Zz4Fcn6DW!Gru)bJg#-Vg6|r^^LArpd|A7`MHduqN|dv z!-h6nE={d*tbiNE`01qDn@HL2I0!6-Xatt%QEVw=XW8X4BlH5~9kc>@F4K=mUVXBb z*RE_FcV=SW_v5!>Jdo#3+Mcg%{4df4#zcM(h|I0^#BwuS!$Lr@`cig(Q&P3a&Lca7)M<_(IA1V>EGFE$ff7cV0w|v-270>C>ZEg)f{(s zAK6eg{kzewEw`vr)~=b2TdpO`_S*U}LsWF&;ZS2%bXan1z4HwkbwC)oc2HrkS1U#+ zhfOYRD^h$e2la(f`tBZ^40JbU5Murp(t)T!{{TDD0AonGDFH4^=N=nr=PAVSP8wP8 zOd=y<7ZIzPSyFVp$Y?d#eN7Md+nz2VIBG@I*A2wwH0sQ|1I*j#2?z+R0CWfMeL91P z_>pRdLJ6CVi>RJ9pvG<~Ch|Z2m70c{^ywn|dAaY{oig?}o+RFK350m@Ks)*3_Y2Cp zqnJ+FA@z~3ey=j+M;|)A&?UKrg4)R|EKvnxlfdKYU;Fw)!8N=j-A2Wakgs{<1%K+G zL1`QN^XJbYiFwR!oA0s?w{6#}iXab0>YaYNj+)sk_*hdNQoSbo(`%3hAaZe2Kj`HV zNZ#zSTrr2dh9`;XBTfYbC%^-LI;f%bEC`J|_*S#Zki_hlEI!lOI@!;}ih-$Q9_l!= zLBFpkh)^=g=&(`5hT*XyjDv@fX-j{S?HjG0pB}GBGlX#lPfs6VmM=StlfICntA{@% zX&E^A=fg&)rE!nizIb!~`@Z|cbr;ULOg4ciaq@CA{xbsu0bLph42KvshTAqd1Y zjWQYzb~*$a9$@YFHge6PjDh`Comk$!PE2e|dvdNeVQQOzGiy=sWe0zRGpLRueMC_< zR=Z|Bhfzc90zwfOWTR{{9oYuH_6wqb?_1L4tYEBE(t_XVP>nM=>t&rfUJp{<>SD;xP5-7Mpt?q2hi-0-@wlvuF_Q_w#4;0wy0tZ~#ve6-dV%IQ-3Q=(kco&-(AD_tg9$0Z8YPl}fS zG5OjO{L!3Z2%-b~f!tr?lQ#KU$IO>^W*IjN9p149hXrWMDvGG#Kndl-FYxDcn))~1 z5^v10pF<-fZ5KP~4q3#u{BUh}PcbU10mUCXJnB2&w6xq}1g`25rszA@oRUI8!y|q@ ziR>F0e+&qYaif)xlf;07dB0HMV!)>TPmFWaqY(~d0+1rJv#{`Bj`RHl2^@W2$b5o9 z{K;#Jf$qRZC#iJKjD?KED5JG=BGH570?jy_O0>2A;1@-4cvo(vh~o40&#y^6tmhb+ zJAN=#86E!7Enywr1K=qLJ$kfwDYQXQ53S%?H`UkJIlPcXaW5|~>Le`zQ`dQx?;Sr! zUh{uq(hfR47(e_%(*3K8Kj38LsNoF~xtqjON(b3zb4Fd0r}Rk`zX&}SL`baQUzL39 zFnbgbVD{;(n~d!8k`I>xp+NUSN~OR4?3md?3gFRUAAX)EExVn&6+cWZ>T2^Co`Cf5ZdJf!RWwsK4in^({owwL zAgQ@F9Q}>V=Z3%Q|T^Rx36Gpu%X6X;IAsFcI&owqT zq^@&CnE;Ra0;=9(dk&imk|e8NZQS!`I5R=`ts!H6BhyzbH|2Jw@y*T6RdaJ1B+$OK zyfjfCr)ubLYBt_g{Rs+!_K^2WBCzBy(g8kr>aXwR!S-F{IL+$N`;Vj_{RjE?auiu; z1x#2NCYXrD{?LRuNJfGuEfz|6K>=+0^V&5!(Gmm4cWHv#TSj)D1xIBcWvDvAP?Mss z2(6-uWJQ3>>H+A2uV-|3juOG>5f4fmz`_75ssHVTQMK(N2f7|Pezmb>>jH#o9lH!k6H1j9rlyA3Y5deLvZiSn(@7TW z!sKxucYcV`oXqMGR`!#mX^al-{V&aSTZul~6RV)SSRT6En%6I9D&~T!zgN3by<^Sv}j)$;jWOx)uXJ8OgCT$ytS%U@y5a< zBKSROy<0Rzx2%fB&y#;^-t+byO$+3I1aXo|Rq!O4*M^q*`i$lJN&d^i^@*6?*T?U^ z{6n47H6}}R*7SzN*Dhz@;5)6n0m`5GH$`G*u=`$=3QgjF20*}*?*@3mi+}VF3Xsfv z-qgmWUAOV#g zWMTD;$|x(pV6BvN=4M=svRyT= zoMN#E27e(|#Dr*4+4Y#xLu0_bobwy6L5=v^(U(DJ`~}Nr_gnt)@mE(Houb%aF!c*h zzP-&Pt+NOvut4{s(JDM;iY{LsvZ@9jgq7z1tF5O_meu1`|ItW$tfzFv%RC9<&~b%! z_wTsv!$P%<=TajH9|@>4c-e|T5K6r zJ=J}&Pc-!XS9q5k)9P>t8t^fZI)n6vVqz;u_iBf?x4ws16{`VxF8Rd>;&(--dp$(5 z>Sh$dt7V`7#`#a->qV8nD(&|qr|*93Dt3%GM7J?mK6eHZZ}1F7EG}i-m3`(-d)jZG zr-q>&G-(zvuiaFTW8$N-`8L)8WVe)BRKiy%3IhSGP*H4$=koTt#pF-AOPD~sz|Z=m zuLIafz4pYSve{T_!G)fnsHz}9o|n0MNf&H^I7>*zbwfCsaSI(1DG3WCDM3L&OW9r@ z2QHIt;j(-;=G|wvYm8N(s4>5OJv$#Hd+9(}gjP={OAb;y&M_@`5CAu7-W!aBv$07O z6Bnzlo22W^(j1c4DD{52ZKIAmTk?f?$7XAPjOzHo+_c89x0J-CnyrWbN{UBApd{IYIx{y;$2l4qF$)#dGaxfDT z7RoyxpV_=)de!C8cqahJ2D0bV{JEDFlY52g?%Zz4P5`MYNpi|ssvr3fwP3@Wfnuk13olrTH4J; z%jZyG#qv7ccQM0XPkNSHJ_#Lu?cEzH;WGd|r|{i&-y8__7Qm0$QlCb%dLj0!x;ppB z#sx1%t1~70g>42#u7-w&y7T&x(`l{LrO___$sqA;1ktU1FGXdjS!*eK15GGRU~c|r zZ-ov9;pb0Zy7(sEiY}Z&e$?k%|K}(dO@X_#fw1`e_-pIV@dQM?_L)z2lXPUE4Qxs- zBG#&>T1K~nQ;T($gRltlBF_&O7fX#IpX|QEMz1^FoNaK@t_l6Q2axu?%G6;{@YeA? zUMrzf#nyRG#B(0lXyTKIH)9g>{{!}u#pJqQXb&aA2{JrPF^zAS?hiX?%gmBDV7p#n}u zLr8ax0{%|blG`u~8obp$(}8i()Wii)Io>y|9L#Qm*FrZ#({hYjH)u7E=Wvuk5;y=z zW!azkK21jlgL(D#puwhH$i##$?{cuV&Y^X`$U(D0_s^vOQkUafL>cj0!VOrZFno}v z=W&%?#nWQH>&m{|ia-F*h7L`=iZ9LP2s9>}E7!@71%X>_r=5B(Td789MqPd#U!N|= z%$v1|A%broS&;{U5sE{9G_M9)x}#7({LMPfmQxSx&a!`3;~Q@7S$LFJP*KK4lMb%h zO7?oWO&brFZ5&a5|2m_P@eqSFR4E;uTV=OEJnV8H0<>3w|A`1?UUj5jZCH5ihmDK- zVLNP6WbxMLsRa*B-|;D=4;jRYygi=}K_rqe#xp4$ELP6$bR11(r~3SQW<6U(X9CgE z+IFdNYjafin+Axe9cMdsySZ36S$hvJ`eSdp`1Q+8Vr5yK^m&QreTh`BXhPO_gQXvW z_2(w50Qn;AiqIcA?%1~LBT1=jCWZ8W+GXo~qmTQ#)@e~gqp44qQ6clO1VS8q0#n$X z?j7#YS|5!9Q$>V0j-^-VX!P?f?IiaG?=Sa1gJhji8n9+Od)Djx>^82NmYqlRwQ?5D zIyB{w`of$ee1i7dn%4XTPM)`XMUXC9bBqD9NrYz5wr;nMlJon(gr25I;fZhWEB-7=T>4YLUhZ96gWZ=%q4qUe&sqf5pY`E>}|LfR=dgtz(Z_TT07SE z;`23|`+2c9Pdy)xf(s+ zZ>>ut>t15VShNZ#i}+q@fWEv-oOMo0U^o9O z^b*#3nsYJWJp*OlU0ZtOiQSp1_y4eriNxJpLy+dY93*gWVO}-CO!S#%)Wuklbq9Q9 zCjAx;ky7vL`uU)WNMmgK)%L}wT_YcsgJ|B><`J@I^qADLq8Z>M^S8IQe!DZC9Sd}w zrhf~(0k!RR@NK%y4G2)yEPoL=_S}(Gb^45=S4^($6!~ zYqc1NMSeC~+W@s!43CUmai#R!ehETMw{Nv>!(~8Ax%MB%N|*Be^fNBg(4Kq>9ZJvY`W&NUPE$Ru|;fiK#%pC^haE$n_0H6 zw7G2!(-ki%rUJCwfN{=yFC0CR0AgrVe^v?dI=eFElC?5}K-fH3CDJcnt+$lb`?CxH zNIihcL^*8EYi4@Wv7aDT=-=*UilG-hZ7L>-59(^VAxTa_Vd2JD+v$&4t;crRn`1Cv zqQ~K+9oaK`2OcVqF&|OJ=WHWl3)iO8{>Pi`U0m3P^~--J8tcFU9PNZPK*5=>oR7+5 zV?FfUKjT#}#kw8#du49krn%*>j_Wn9hjV_ub$*S# znKO2g4YVo96F|ibu(5%X z_~Cdf2Yk!-0%Y5R!=onk?V*Z^o-~Y!$*$R58GM-G2G^h^W>5^hsCoF7ClhEWdTw z^Q;HqH5hl`ET2&M6hiG!a5nOs%E`gZeEh3b>FqwTho5~u^17V{~L6)YCgR-gtR8xD=@hm)Y{??5j10z3w#!u2sPftdQcmFQq^yKJp=H&DX z1=&a4<3p$^_Ab1}K&7wgs~NDc5DN8MF`dVBC$jFPeaWtN@IdCQr}uRHsna(135Y42 zt^&$V8nUrU#_a45x>Xq$zpl$7n)neyCm0`oDhcX`a#wO>4LrQ$}1AtS=9EXyYE}ms2J4{g}9g6c5;u z;XH5QuH?uW-)M(a8nk*syH5?{x1ffgYU2v%1OPZc^K3VoOk|FV76zZq=Ok;4*5i;F zAXF2@?iL+2&avv6o0&~1AC8!}CM#?RE1MtWM$>u6G5(?237))~_m~g4_GH2O#tu3> z-lpS)-=)vpWyR`)K4|b!MdI6~YS+}uL&L-0gin&szjpYUh>JsmUw;vKvRnLoU+}qH zTI?*Xv4n9*&+{HjS@3)w)T!jOr6z~bnR5a9;K{^i`oUo?woy&t$JKRMPO+F$r$id@nDTC{C=4otogQXVCH21m)S^ zzarnSJm0Xg4t^o?4VJ9x3h(U|2h%6Mpt^i1x;IEjFGJg%|9jc$KV7Ws|7m*mas3bQP9GwEybZ310ryE0VR2J+t!#sXyj54U(99r4O10@7S?U4YpMGXc}- z>2^2YbnqWOmm|4uqb&i;N*hTx@7n1aS#$F#jaJAm=8f{x&5gD~mLSsBKx{<=R@OIm z`y*J;Q$;@bn#fwcq90Vv;7z_#l0dGcf&)dI$EUS#Vgqc)4Md->Lcy^w4pAWb+Mn{22 zf_2sJ-tI-U(egZU;VWWdlyD*f0|Cg)4^IEg4Vci+2xuRGc50!`oeXqgD!>5;B9^~= zvw8J%wVG84$Mz4LUPO?cUx?$O>E3>*~PFiPJJ)`EP`myb|tsMJdc_IDK z_vHVR*V$eVp~#uPLVTI0LoOmBVzo-obk8Bk_od9FS5;ry|424A_uZGx7=e@KT$_(g zynR=2Z#AZhFeXZN0fdI}47iB3OR%Rsxelj0gwTYBM8JesBd>NI(CX)bUY0{KGkN1e0bFLjGEok3-cw7ojtP_h^LgE%ozg^ ze6M8=H^F4)UxDaF(@3m|D53cbbs8y!NN8MbV(Vw@Nl{TK%U*{SoGi!g!&JJD_f{G+ z+(<>zqF@3M-@2}@ZdQ9;N%MG$k)P+*Aeq0QLdxM6cjb0^mHlQi`$*w`h#22%4^_-7 zjO8WlQg!MqHq&}O6aMl6!j@c{6mn{r!%22Ziu)i?ROy{8 zw_w?NGGlJk@wcz5lI%5G8&uJJczKaiFa91$@wyZE*5-VFsDz^^bvj?zavuKpG5C$G zW<(g9*$_Gk0gsDRm0`zDz4fO%TndS3wX;F!5U_#X52$x|qd=}gK~Fz?Z3qNl2NI#)AF(j(n>RwGknzDI2NI0S0tLH^ASmRh zeSrLC^Cn6xq=b_gh2RGcdj=04jaye zwp+r>iveWn6GFr4wz4+!*=-e}MmM&3`x!!2w%G^ADpNAS!{#O}qL5v+V&%LMY&bS} zSj&PIjZ1b#-gJ?98G;ebYZO~QViQ0?sW#zw9^c`8{qGDqR9LlRbodLY=bQ3BVA~5t zHx$>`*UyKGs;zZi_PJm_gZKVM@E%dy_|i5B(YkbP(B%kDR8%|n0oBfKdv_N|)lR+C z5r$T?7a!NJgDiuanDF$oEnyPm&w73Ae@3IbF^ z8LMtus_xYNEkmcY36?t%$Y+V`9oz`-eiQ~sIzr`K`mTYeT}e*N_mId*gfYPvvK$xZ zAIJ9JY^pR<^fdcK(C_#!TxWC{=dKc~se?g@jFNmO`5UseZd4G6g9`v`{E&Yq^h*GY)t?(Cq z7SNm>2&$Vkyt>} z;oB1g_Z(4Pi)fXR(2Zg1D|r3`i*cr_rJG_wBPt>~x`IbIcc#{S2;R1!DHh5UEL<0XpdoUBIQ8ekbWmRv?zX*@HBjfy1&3XHxc?%RJr>*@-nKQZf z0i)q9SkIgqv6McUCo3Ethb5I#*4E#PU(NloMj>A4QvGEF3RP;RObxhqqCqCrSw_7T zB&=eLoN`V3Zp*Jf2L{?rt0VBCMxX=s*mjc$OO&bF@#*mSm4BBRH9ANvzk`cxJ&XLd zxLj{Ny>1-8x&Cwh(4krQ=+OOiaqE+L`;&0KlMW#aJc>#>F>Ep>Ecq+w1SFKe)tYep z8DZ4kCt-M`I5PxvexAs_9L{OcMh%)U6&j}M>cy&Zh{fOSVX7Cd-phLRfHXozA52d} z-BOz2K^MASM*ehV@mfnuTmq0jS~tA4yh)XAS4kskTdkR&;n9M*5H%3_3Lg>@IXZfR z4U6dl@#7qcXzIR0`s!ykGva3EQE%ilAwMc5^LE#-;E){IodwvecQEYw_CccGaU*WEGG}y zGQzY{*?~tW#2B5*cs!aWfSrWHIDp&)3Ox?K54I2bzMdO*RFAKT#Z>j>eZy)bRD#!E z1*eoH*OJ=f?(ueEdCXyD$DF5~xjBwS*CogMwnEc`83Z8Jz}1``DchM%eHr`_N*+X! zh8u81f-Ja`U~TiER)x2J{82=!6U zfnP`1Fzfg*RDfvEDpouH;jGl@myZ+f3y|&S_h)u5(HR#6^NW2s6gBhMB=dt~O^zPd zAYlIhOU+br#}zsZJ3aOQ8+I;v%R(bzrd21`yay*HQl?i zN``GVYHpy}32!rad*XDsavuSlNEFZ;M6>!Y0n6n|yL>BqTf>n${UzLR?yZa5@YnQoHxG5t|OVHyl! zx&hXbf4gLrH^v7qj3B9f8B9&X z_hlS{;x|?^W+r=Z*#8?$)nQ#{(ZS_u?k6S_{qAN!DtD_e#V{iNeGIyIl(EGN#H{sv zS~QM;O2}5IR;<)%uRoI9ai2P$Nlw`>Mjoo}30oK~7BCDC4ZB-FgBX_xvM>waaCK`K zUyc4Wz*zk?7bXSP8MrsS90I(gcch(9RN{Qy(D2lVOw~Zh3eZs_YXl=S2LIE=y-cPtbs*(!A!ijSVZ?h2 zr^@ZLk~%yM2?HTrQG-uh6_#t|*%d>3nL6C=C+%=Rtt$^1^0c&;_rG>Be_PE(ZrmML zXP`c8}DZpsXI&20LN;D68L+iwAtIIvrG1mi+s4Uh<8qE}(?^vT~ulkfK zO5r|=2B?_3XAouIaK>F?Z3UwXCuAgIV$rSsGd~ObtCq4K86Xws>Qs*Pqx4n1kK@6+ zFE7#-VY}b;q}520j$x9m9};8QV)~*Pp@xFQ%x?q&^%($O#qI+1^BZi}1Vk%F&vc%yYa2Q}ubbA-AnW$%Qj?vJEMdHv61v1^jYCS?q41CPS(XZD;(~w&aI*aE~0^v zx`oCn_b&R_OBnM$Pnf~#`#KFR%VRrjZg{*uy=NNaOX*;?ajWC&*=X5ex)fWWr_ekI z-Xs_^nnXv0avn}7mZ&CtVDD+-cRWp^3+cQ@FfT*kE~HqzSUFiKwcvqS#PQsugUl$02NsI81-x#jmDTTRze4{K^#J#T*X{7^s2CP59;O-FXj96iX6`Oyqh~dJZ-kBh=2z3y7 z4f=(SqaD>($U=2HZ<0-AT>xfk>!p1a?vVa%6VLpN1&Q8*iaOSFzZ@AGGu#mIH6KE% zBBHk;pV+woO&TEHUkB%GwFraAV7yO;UIc(2e%bso)G1}Umw4D0d}uL^^=b~67u>25 z!xDla-+$$P&Ve?|u74%R5_O0ew`oIO!s!coW6)(28GLB~w1?1-P0F^!Z0dY{&C*i^ z*x}WQlgYt?x~gteqX(E!u{bwQD+)Mme00(YQUSN4<@TWE5I23$s<#@5COiQjVexMGwt5W&=I@{fGWIxc0QIp72p`cw|Ql3THA&jCS6o(uJ! zFj6t3h0X9WHk(zT$Boi6E@-qW?uLg-3c(>hDE|7}IQ-XU96k;n59nq++;6?3PlS0Q zW6+lBG>o2OYsFXU2sxat_I~FH*&lge7%whT-wVrIwB2Xu?f@&G$I~sIme;%*b&=Dn zL9Q5A4s~_)AC{IDzDH?Y+xHO>%=Dq|R|1QsdAIyjVM^j1vVsqbmCTj$oXS4_;zik0+Dz{xr( z`i3)oKDITNT6%@tPN%{(Wa&{&+-`ZVkzLw3KYAg@y zK+XT?_*? zSB;)YjEggd%tl^>l6owlmA0IU&sq`vwMY383{(m(PrKHCs??_xaXE#8AR~&B-Rz3B zoAR2Pu2`!r>odKQkojQaee8gNwq`!U#To|VrxgT(reBq0-arhZmsCOHXd!)zU{ zS>ev&XaYui1?UId$8Tvxopi06dzu!T^hsZt@cmOi1qN$Ji;{y+(KC8@!pXq~1h&>8 zNt90JhL7m|4ab6KdwRy<5t0#HC+XBKoxGo%R01QwGT+BhheJm{SZVE6KBDz~RU655 z*?0O^0%%??7!@ET=qu#yH|H>LgEUtn76Q z3e$|w^%K@2pRuCf{JCsW4La}dkZZK(iiNhah|{;gJ@J8`8jBO9+h|`c!`%EC?&Jc1qA3LFQzu#t#;u?%5L=6QutigqP#qx4UnmW~s@D`sUwj^$cmEsl#R*S62VZ;x-OV9Ze%=jI4&bl%zQYWo}9dV^>NG9&cQFm@P>S@ zd6Q3B65WelrSZ}@NQB}(M6#E%?>ajA!7}s?8{6v~UKvogWwz=~1^+lu^*z^jlr&NW zH+#n}x4pXW4K&Clfz|TnUH7@!7US2gOKc-{n0$B!Fv#>eX-pr-<^U@OR3Rg8 z+&oY#|4go?e?w`279_pmF3HEmzWc||f4KO$Vs5iur^SDBt52^gsOxM>Z=z__!|jDE z(-VyAIBmqWDc_{PgziR7UvtvOcRV#VrW{w%XFsRHh1Iwv?q0N{r1R{0DQAB4uL(#s z$y*scReuS$qW-R)DL9#9ctkNlSjsBsqlxpDtfxX6jR?XV>j|k8jocha>W~t&KC7M?v88q{B zY?Ei$Hc|zN31F3)6m^$FB!6!^;_m?Y`%4F%gh(!e?rMXme4O1E>Wt)~`te3;dPlCq zJbAL8r$pIQCVp)&WagHII;_0Pc^#Ombq|)5fL`W?&{@E?E&qIdNom2t$oSpQmY(d@ zt5=^tv?xbgf~rtoH0$lK5KXb~yUz4DcOi8QLVE`s!mieNXW>WXRDCQA1X$?N>Hs;G z*oJGZxG)pV3CiwYXX-@q)KZ!+V+D=;!G5Pw3Ih!xxP_C5r8witJr3A-NJe5$Af%&q zlnhyc-gjQPIxP97^Getri!Jm$&<;(J}N|lo`4dEcIjK_D810z)C@PAJ2R`z7F!&Ad_%FM z73~W%TpG!yG1>%&hwP>#g_1c+Vi_E|=afWHwM9!6IxIDUmmOy*->YftBN6+}TEq3N zVtUgD-%e%tiRH^#bH}-@{_mgItF#{WNU%gqfcU92P)03tHHK{dys?IkxH?~_Ju@Rn z&haZcv*y`Zs>fql*h6MoN}RsRo`LIk~|Spycw*es>v15V9#M6r zR>4vo676tAr@kx%;6mGgPDI0^5*sCI!fu7Ip2N`F68u z@l0R9~Pjo`yd;Kyq%r78)-$$Ee?x8 z`36jw8(VKo_zPFln8yy6vorSi#c&VPN$6?$r~C(rKb*aGoc>QOK1Z+S_Aah$a;S3Lw* zk+HeuItmx>kb>Za5L~B-W|DV1DQ>HnF-Is^ zn_z8%@v`%%)Pzb<#*JQ6?U9HS{heLhSPHN9G5!)!?g>*f@;dSd80tMQXJcnRTak|> zmuCC=&lUaWL-f6uhv4?s1NS^QJ*dFR^q;TWA&TH5VEew^u{f*0$C1i(bUjK%O?_)9 z!Mnl^_4}=|U1Tqjf4tQe^1?T)TtkR4F`SA}@Pmx_(LNCo9g@Sn*#lWtL41VN1~g0Vpv`HLU%mT@lyNId`ws#P2|G6p$DRm%2ZFj)2{Dxi@3 zPG2t~Amwc)(i##vcZ}mW&Q;NdGO(9lHstwBjMR?DL}n(u2GKe~5nCX_oq~?mXH+7D}7?1Xmk~@>3=`H$VfN-%ued;)t%{L zxpAMyBcyq`10H7ddO-XcL|_Q6iH0wJ%uHP~&JUO{GFy;dooo*}97R!kx~G$t3k!sr z6-)Vk%98*V@BNdL6Uxa%?)Z43zTCf8Maxtto4?Fol=U!VO{0Y>6-o*<2B zj=GQlt8|bWAO}x8JaN`nO9%}b-N^q8Ree*OBUm8CZ_{~DeE)r_St;nGT9|mkA*g=s zvN`FDX^mvyR`R^J;&m$dySLI~Iwer9aY|swvuZ=66yTpiUjbl^%h?-CQ&8c&t*OfN zpWXk*%m*QNm!t9nV40Xo0XGeaT33s{fQI|sBj^vE0vNiKwGSTYH#~VW9IlgfGWT_6 znq2VcL{m=5wu`fV`74chXix*j#F<Gy_7>vz9D$u~E!yt-aziv*RN-?i!muG^F6w6G&NbRy7ub$yZPIk&rAKNG7+@+4t|_g+OvX?)mD2oo#TJOufy&-o2x7Q^jS^< zFxB%PEb?GsasR}gwUxlZB-f>YQC;-bl*)sl4E)vdu~%iYzh149as(Lc#GF?J7@>v2 zHi<)G096?zC2gJ;B?||E!$S>N>pJd8W<2SmJ#e@~0NGHF+)NHk&bWSl3xYdQ`R2<|-lo_s%yPu&tV# zKUf6jYCu+9wT)Q%mhe_jB^m@H^?i_s|39yqbq%_Vi|BMY{|nrC3H6Up?Kx=-m_ea)K7sK!7$0+kQkwg0)g9f@|wc(|#O1njX|sjXjK?yT1O_OqA? zQ!id(Ic<{S73VlXv+$sLqCTx|it#ZdSno1FZyd<_9j!^#_w|Ilx41js`^&<~Il(=2 z^(FdqF5yEOrXed%s>8QZYJ3*`G~hYl$DcACc{fIK@@I6!lB{Qwlg2cWR_Y1@$j{=* zsf#E*tVh^195rjnh7{&ybLUx%R8K0r_)AGWMMtKt>AeiyWUv&itcS_I;o;?cZ66X; zAHtBiVIB6q|0a?DWag|g$x#hPKzT2nP3Z~EW{U)qd`Pj0N0d_L$+x^4uY0&jl{1Q6 zx$ZfAxLqG~n%Lj9!efTOI1Sww?Ct$emXN|2C_*(T&kTm0dmwYZTM}OhMplb>wbBDF zXs-7-5?^_Ec+g{E0^E357($DTxnNJ3n30!D z3QKv4du1;a0vhMZcy=6GU82e#yx@PZwlu$3on5T7uRp4Rdnf&1e= z`b{GO56H6>=gpn^jYNP-bNcr>eHLIakw!eZw(W|DPak#nKZwR4IQVDDrwC)fPJnKnkM?fT75^<^Wf1pr&y2=Hm$opEl+@=yEn(gRa+1M09GGh2m)W@Jy zGRgcW-`M#1J*p}%VA1h^!ftBcdrj{s5rq#}hF->A^+7Q-*lS1NXEIQ1N zn3xKh(#&)cU)b4^pA?4OZnHt`bo@7KgH=O@#@f-Jm?2O-=(8+5>T&-^z#Vg)bR0AD zV0|bZgNmEoiv`P0F^Vz19=emnW`i&KY5$Y#M`sMke2(??F-^}d*#I}7s2gN~r{jk}cF#NR)G zDrFEN%cDU%wTU8jgLd}az$=kN2XRkC(#0o1ltBD0tr4G+Ex6xAJ zEheTwST=i^#5ZmDp?Jy)9;+&5e$qyej z*Y{T3ylHVNnP6-QWmSAm1gLeTFX{Reb+WiqCA8XDSy+belhJP=)x7U`dF$xzo&!A7 zW`b-;vY3Zp-`Bqd4gd}JhZ@A=NaNd#q~>E^}Vn&+V;Z^pw%jE8Q z)0yEnb(Rfs`Mf}m8~CFSym9hf8f@vbO;sG!9M~k1Jt-<>Ac!Yc!ulGyltRfEWCr3b z$uXrm1SP(L;*OZPC_OuN!ACH@xf<$#%pVSla&t7YK^L3DV~WGH*>8TIuBz_kL)NYXUHPyw?ia30LS9*W zE28@OhS=al53}{@XmZ!AYklQ*)UIk2`TO`GA#?^fY^CL>HMbq>73A;PKc0&fne8Ei zCQA8?WJYG*!6-`|A0Iu0MZ)a`!Lp?|1|6p)NE=>lyrW|JnnI-u1@z_@a(%br#BDSI zy_vXis8+j9MLtD0v3z#8m1HQ{rlrc-@I(Iw^lZOZ#rc1nv4{R04+ zI432sD915e@!tJhe&g&l100P5#>s)_zI z%n^SZY%iVj`@5w4?wlI{pUdcW`PgYau9uT8=oJYxH7nIIsB99LG|vSBDKoj;bVUKn zsxR==Lw9+!Abi0CndX`&NQe6K_!;9|n!3~Nf6dX;dK!vc!v`;JBVv^e;u$n2n?(>7 zB`838>kVIuyY9;Q;JQ?IG}~%_6_%m+S>1$g%gM*5s$7SRj10}%aT~)dezFEz&65u( zIV~i)TTBB!ER}$e2c`k}&FrT%$@rsW;e-t6sgGuABRaTjGJ_?PhFzQDEf$Ub)A{d} zYulmglOVVj+b{678ceu*I5P8otQ--mxXG}xViv?EYDxvkMa~EW}O z-Ye+5gg#)|9MNfrf7jG+<8Dh0r_yqZ#DWY7rVPCX?oTIQe#zK_w{=jkUN))HihRhC zeaD$#h;a*LD4Eru5SP+aCOFCqa2wHM$n-fT;h>tqBwz>HV98BwHJ6{_EP&Z6vF-D0 zfJ9?_l@FDY?0990@w^Oo1~ zYyw~p&LjQ9Upr^&&%liQP-bJ}<|9-1|Bu`lbpC+{kzHHHK7&RqlNMx!e>do_(F6ik zqyA;O#>Nu|YlU&zZ@*fF?5^b(VBvN`WN@o~yA1!)FQC@XtJN8)xlIp1J>L9%*sQdw zml^i$@Oh+A(3yW9gyZGsgWrW)=W28F(nzym8|YD;_2r<&Z+$CL!ECSd#t{V@bli`X zprEFPIs2<%xIy#mY%__Pwg!5|TVnZ#9!mCzX)40KaQ;m3eNLB<1SEx7VGu1koixrr zI?tx0tm6XMlS}e93(q`zu>^L#b^4z?^)K`B_4OY9LH)6z>sWqfmlC!3h}(hSp#uNp zS==Y@I>g$7YenaQpZH;M(o>xf2xgqt%$$Qjq`D+W4{uY1&EKQjEZvH8EKE10j7mRd zLzdS})gGQClK9&&%}1+RWquO@iluM8h7}bWW0KioAQ*O$<;bz5%o(>~GCl5IxPXz?WenkK1k+ns)6Ru4IpPC@VJ~bU; zqV{jg`L#+4Ldo^cq6BK|Bi@8h-P{-3eRrH0^jr0}K_V__+2l!vvjT1hi$YWJ5@zPf zQ&mn@P7MJ>jgb)Y0nRs!xMq5oy8bGQ^x?u%ekq+-6d%z8zOud$bwpZ4i3Ex|Nc)q* z$W{1HxkLnIudxfcCIa5+mRq-W5m$!6p{s(<{Y{k~z(St^wGMt>hKtFD*DTTNvQdvw zFe^^EP5D+xHZyui>6oN4{6?Iku_zhyYjdkfOdoBuxe6`~9&&pQ0bFEKw zWxls(>wU9mw70a*0dQ0NoM8|2gvrP=L(Rt-zmf_KrCf5q{Mebcnl$_$Ru*1P+#K1W zG^I3qRq`O8Cnjrmhd68j-8RIc74G-;md41eEK6mryc)tgm+fFhCvI<=d~0G?behYm zZT#>kzPmJ~bH6BCQ2n;oUm|C>C$M&A%)`nq(4#G;vzHB+(-6%eVt+aU#emxsBgzVk zVn>6%Iw$sU@vt4}3;vl5n*8f*cB3RfT>D8MJLfNA-fuZXxJB%_>FLOgJDmd8P1nw3bcx1UP@}2@HJC%mfGYUvV^p@T_;c7mg;PJ@NmCG#33naRk^j!RLx|6Zd8Kbp`AEG$h!AxrOmT zYw84F6Pbm4t6p2E-0U}Y)^|cSOLRDvtrHNOaQ|3>@Kija(7%{FUOx`Nh3auX#S0ix ziq55K`0;(B>2mm(WBM6Yn8ibJaY)RB%d0%Ju=h9>|2xeJWh-LDa$|KQ@rwOcMn-BtAVR(i9B?w?rMDJdU<)9T6U1ezk z-jFfs>!U5d^uP2#&gPJ}n_{h02}9o3gk}!83zhyClT9`U$3-N0JA3Lm^qps6I@ETm zYRDjYXmgdUxV)L(+4`#CDnbbHoH4OlD(Id-5x!QONyL8>ns~oi&qr>4@2^J;6zMYV z4wcI?7m&?#lBADeDWT7TKJoabf(Sq91suxiw%yAZ8%yuDsxZt8sLH1nee#zr^jx(=m z%RI`fGSgFlEHTH)15((7-^mAWiPk)WLm_ZQbMgwqC^=5aEA6$($SUG&zugbjdBT%f&!<6Q%H zH=EXy+~raUgKOqLtdUgc_lq|!Me^TOL!hkP2lsIfB%&=rS<@XBAHol3oR`P1ByYzm zfOF8;6}|181f-FK?KMN?35QFk^?J%uHEbQ@K5RXd1*7dpFp7TdBISf*Q4`0=95TkJ z*{c-x^8MQ+xA|-mWNW$~oxx3=!D3$=$@i8o@J_~+7d$=^=~h;YktmW*-ra4h08(RJ z&fu_!a`&eoY20ip&7;Pr#0N**q%EE$vHS5Rrr%Id3D(L$(y(h6ndRe}@)!FmL0tL* zRF{h)9Qwpv3v388v<;+1ME-#>A29!#-(zocd{2xo&tj((gMkxou3NHLH!ftsS=Zvw zZF0=H;TVhA_$8_@bz_t8XIe^GN99G8`tQxn0iilC`fiTgk1dw>(Tzk+6;x**@WL$p zQJ@=Io%eHxSx1DhthDCrfpm^5Ja3haq|<#f{IXm<%dj4_J?&WHw){wa+M=mloIHlN ztJx)x3A(Ib!*TWs#~{7RLth zSAATi59wgv`5q({ru)W61?xhx){GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ diff --git a/samples/client/petstore/python-tornado/tests/__init__.py b/samples/client/petstore/python-tornado/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/client/petstore/python-tornado/tests/test_pet_api.py b/samples/client/petstore/python-tornado/tests/test_pet_api.py deleted file mode 100644 index 468dd867f558..000000000000 --- a/samples/client/petstore/python-tornado/tests/test_pet_api.py +++ /dev/null @@ -1,220 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import unittest - -from tornado.testing import AsyncTestCase, gen_test -from tornado.ioloop import IOLoop - -import petstore_api -from petstore_api import Configuration -from petstore_api.rest import ApiException - -from .util import id_gen - -import json - -import urllib3 - -HOST = 'http://localhost/v2' - -class PetApiTests(AsyncTestCase): - - def setUp(self): - AsyncTestCase.setUp(self) - config = Configuration() - config.host = HOST - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) - self.setUpModels() - self.setUpFiles() - - def setUpModels(self): - self.category = petstore_api.Category() - self.category.id = id_gen() - self.category.name = "dog" - self.tag = petstore_api.Tag() - self.tag.id = id_gen() - self.tag.name = "opeanpi-generator-python-pet-tag" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) - self.pet.id = id_gen() - self.pet.status = "sold" - self.pet.category = self.category - self.pet.tags = [self.tag] - - def setUpFiles(self): - self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") - self.test_file_dir = os.path.realpath(self.test_file_dir) - self.foo = os.path.join(self.test_file_dir, "foo.png") - - def get_new_ioloop(self): - return IOLoop.instance() - - @gen_test - def test_separate_default_client_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client, pet_api2.api_client) - - pet_api.api_client.user_agent = 'api client 3' - pet_api2.api_client.user_agent = 'api client 4' - - self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) - - @gen_test - def test_separate_default_config_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() - self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) - - pet_api.api_client.configuration.host = 'somehost' - pet_api2.api_client.configuration.host = 'someotherhost' - self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - - @gen_test - def test_async_request(self): - # It works but tornado is async by default and creating threadpool - # to do it looks crazy ;) - thread = self.pet_api.add_pet(self.pet, async_req=True) - response = yield thread.get() - self.assertIsNone(response) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - result = yield thread.get() - self.assertIsInstance(result, petstore_api.Pet) - - @gen_test - def test_async_with_result(self): - yield self.pet_api.add_pet(self.pet) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - - response = yield thread.get() - response2 = yield thread2.get() - - self.assertEquals(response.id, self.pet.id) - self.assertIsNotNone(response2.id, self.pet.id) - - @gen_test - def test_tornado_async_with_result(self): - yield self.pet_api.add_pet(self.pet) - - query1 = self.pet_api.get_pet_by_id(self.pet.id) - query2 = self.pet_api.get_pet_by_id(self.pet.id) - - response1 = yield query1 - response2 = yield query2 - - self.assertEquals(response1.id, self.pet.id) - self.assertIsNotNone(response2.id, self.pet.id) - - @gen_test - def test_add_pet_and_get_pet_by_id(self): - yield self.pet_api.add_pet(self.pet) - - fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertIsNotNone(fetched.category) - self.assertEqual(self.pet.category.name, fetched.category.name) - - @gen_test - def test_add_pet_and_get_pet_by_id_with_http_info(self): - yield self.pet_api.add_pet(self.pet) - - fetched = yield self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched[0].id) - self.assertIsNotNone(fetched[0].category) - self.assertEqual(self.pet.category.name, fetched[0].category.name) - - @gen_test - def test_update_pet(self): - self.pet.name = "hello kity with updated" - yield self.pet_api.update_pet(self.pet) - - fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertIsNotNone(fetched) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(self.pet.name, fetched.name) - self.assertIsNotNone(fetched.category) - self.assertEqual(fetched.category.name, self.pet.category.name) - - @gen_test - def test_find_pets_by_status(self): - yield self.pet_api.add_pet(self.pet) - pets = yield self.pet_api.find_pets_by_status(status=[self.pet.status]) - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), pets)) - ) - - @gen_test - def test_find_pets_by_tags(self): - yield self.pet_api.add_pet(self.pet) - pets = yield self.pet_api.find_pets_by_tags(tags=[self.tag.name]) - self.assertIn( - self.pet.id, - list(map(lambda x: getattr(x, 'id'), pets)) - ) - - @gen_test - def test_update_pet_with_form(self): - yield self.pet_api.add_pet(self.pet) - - name = "hello kity with form updated" - status = "pending" - yield self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) - - fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) - self.assertEqual(self.pet.id, fetched.id) - self.assertEqual(name, fetched.name) - self.assertEqual(status, fetched.status) - - @gen_test(timeout=10) - def test_upload_file(self): - # upload file with form parameter - try: - additional_metadata = "special" - yield self.pet_api.upload_file( - pet_id=self.pet.id, - additional_metadata=additional_metadata, - file=self.foo - ) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - # upload only file - try: - yield self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) - except ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - - @gen_test - def test_delete_pet(self): - yield self.pet_api.add_pet(self.pet) - yield self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") - - try: - yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) - raise Exception("expected an error") - except ApiException as e: - self.assertEqual(404, e.status) - - -if __name__ == '__main__': - import logging - logging.basicConfig(level=logging.DEBUG) - unittest.main() diff --git a/samples/client/petstore/python-tornado/tests/util.py b/samples/client/petstore/python-tornado/tests/util.py deleted file mode 100644 index 113d7dcc5478..000000000000 --- a/samples/client/petstore/python-tornado/tests/util.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) diff --git a/samples/client/petstore/python-tornado/tox.ini b/samples/client/petstore/python-tornado/tox.ini deleted file mode 100644 index 169d895329bf..000000000000 --- a/samples/client/petstore/python-tornado/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py27, py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml deleted file mode 100644 index f918030fd803..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.tests: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=x_auth_id_alias - -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests - image: python:3.7-alpine -test-3.8: - extends: .tests - image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES deleted file mode 100644 index 93cf0c21cbdb..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES +++ /dev/null @@ -1,23 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/UsageApi.md -git_push.sh -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini -x_auth_id_alias/__init__.py -x_auth_id_alias/api/__init__.py -x_auth_id_alias/api/usage_api.py -x_auth_id_alias/api_client.py -x_auth_id_alias/apis/__init__.py -x_auth_id_alias/configuration.py -x_auth_id_alias/exceptions.py -x_auth_id_alias/model/__init__.py -x_auth_id_alias/model_utils.py -x_auth_id_alias/models/__init__.py -x_auth_id_alias/rest.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml deleted file mode 100644 index f798c381c428..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md deleted file mode 100644 index feaca4b13d89..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# x-auth-id-alias -This specification shows how to use x-auth-id-alias extension for API keys. - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen - -## Requirements. - -Python >=3.6 - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import x_auth_id_alias -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import x_auth_id_alias -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python - -import time -import x_auth_id_alias -from pprint import pprint -from x_auth_id_alias.api import usage_api -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = x_auth_id_alias.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - - -# Enter a context with an instance of the API client -with x_auth_id_alias.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = usage_api.UsageApi(api_client) - - try: - # Use any API key - api_response = api_instance.any_key() - pprint(api_response) - except x_auth_id_alias.ApiException as e: - print("Exception when calling UsageApi->any_key: %s\n" % e) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*UsageApi* | [**any_key**](docs/UsageApi.md#any_key) | **GET** /any | Use any API key -*UsageApi* | [**both_keys**](docs/UsageApi.md#both_keys) | **GET** /both | Use both API keys -*UsageApi* | [**key_in_header**](docs/UsageApi.md#key_in_header) | **GET** /header | Use API key in header -*UsageApi* | [**key_in_query**](docs/UsageApi.md#key_in_query) | **GET** /query | Use API key in query - - -## Documentation For Models - - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### api_key - -- **Type**: API key -- **API key parameter name**: X-Api-Key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: URL query string - - -## Author - - - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in x_auth_id_alias.apis and x_auth_id_alias.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from x_auth_id_alias.api.default_api import DefaultApi` -- `from x_auth_id_alias.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import x_auth_id_alias -from x_auth_id_alias.apis import * -from x_auth_id_alias.models import * -``` - diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md deleted file mode 100644 index ab5eb72d7264..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md +++ /dev/null @@ -1,318 +0,0 @@ -# x_auth_id_alias.UsageApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**any_key**](UsageApi.md#any_key) | **GET** /any | Use any API key -[**both_keys**](UsageApi.md#both_keys) | **GET** /both | Use both API keys -[**key_in_header**](UsageApi.md#key_in_header) | **GET** /header | Use API key in header -[**key_in_query**](UsageApi.md#key_in_query) | **GET** /query | Use API key in query - - -# **any_key** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} any_key() - -Use any API key - -Use any API key - -### Example - -* Api Key Authentication (api_key): -* Api Key Authentication (api_key_query): - -```python -import time -import x_auth_id_alias -from x_auth_id_alias.api import usage_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = x_auth_id_alias.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with x_auth_id_alias.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = usage_api.UsageApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Use any API key - api_response = api_instance.any_key() - pprint(api_response) - except x_auth_id_alias.ApiException as e: - print("Exception when calling UsageApi->any_key: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **both_keys** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} both_keys() - -Use both API keys - -Use both API keys - -### Example - -* Api Key Authentication (api_key): -* Api Key Authentication (api_key_query): - -```python -import time -import x_auth_id_alias -from x_auth_id_alias.api import usage_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = x_auth_id_alias.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with x_auth_id_alias.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = usage_api.UsageApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Use both API keys - api_response = api_instance.both_keys() - pprint(api_response) - except x_auth_id_alias.ApiException as e: - print("Exception when calling UsageApi->both_keys: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **key_in_header** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} key_in_header() - -Use API key in header - -Use API key in header - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import x_auth_id_alias -from x_auth_id_alias.api import usage_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = x_auth_id_alias.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with x_auth_id_alias.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = usage_api.UsageApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Use API key in header - api_response = api_instance.key_in_header() - pprint(api_response) - except x_auth_id_alias.ApiException as e: - print("Exception when calling UsageApi->key_in_header: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **key_in_query** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} key_in_query() - -Use API key in query - -Use API key in query - -### Example - -* Api Key Authentication (api_key_query): - -```python -import time -import x_auth_id_alias -from x_auth_id_alias.api import usage_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = x_auth_id_alias.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with x_auth_id_alias.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = usage_api.UsageApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Use API key in query - api_response = api_instance.key_in_query() - pprint(api_response) - except x_auth_id_alias.ApiException as e: - print("Exception when calling UsageApi->key_in_query: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt deleted file mode 100644 index 96947f60408f..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py deleted file mode 100644 index 1e118ab4a55f..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "x-auth-id-alias" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Extension x-auth-id-alias", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension x-auth-id-alias"], - python_requires=">=3.6", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description="""\ - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - """ -) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt deleted file mode 100644 index bb4f22bb7a6e..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest-cov>=2.8.1 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py deleted file mode 100644 index 01ebfea96950..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py +++ /dev/null @@ -1,56 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import x_auth_id_alias -from x_auth_id_alias.api.usage_api import UsageApi # noqa: E501 - - -class TestUsageApi(unittest.TestCase): - """UsageApi unit test stubs""" - - def setUp(self): - self.api = UsageApi() # noqa: E501 - - def tearDown(self): - pass - - def test_any_key(self): - """Test case for any_key - - Use any API key # noqa: E501 - """ - pass - - def test_both_keys(self): - """Test case for both_keys - - Use both API keys # noqa: E501 - """ - pass - - def test_key_in_header(self): - """Test case for key_in_header - - Use API key in header # noqa: E501 - """ - pass - - def test_key_in_query(self): - """Test case for key_in_query - - Use API key in query # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py deleted file mode 100644 index 61b723478bc4..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - Test usage of x-auth-id-alias. -""" - -import unittest - -import x_auth_id_alias -from x_auth_id_alias.api.usage_api import UsageApi - - -class TestUsageApi(unittest.TestCase): - """UsageApi unit test stubs""" - - def setUp(self): - self.configuration = x_auth_id_alias.Configuration( - host="http://localhost/", - api_key={"api_key": "SECRET_VALUE"}, - api_key_prefix={"api_key": "PREFIX"}, - ) - self.client = x_auth_id_alias.ApiClient(self.configuration) - self.api = UsageApi(self.client) - - def tearDown(self): - self.client.close() - - def test_any_key(self): - """Test case for any_key - - Use any API key # noqa: E501 - """ - - def request(*args, **kwargs): - assert ("api_key", "SECRET_VALUE") in kwargs["query_params"] - assert "PREFIX SECRET_VALUE" == kwargs["headers"]["X-Api-Key"] - raise RuntimeError("passed") - - self.client.request = request - - try: - self.api.any_key() - except RuntimeError as e: - assert "passed" == str(e) - - def test_both_keys(self): - """Test case for both_keys - - Use both API keys # noqa: E501 - """ - - def request(*args, **kwargs): - assert ("api_key", "SECRET_VALUE") in kwargs["query_params"] - assert "PREFIX SECRET_VALUE" == kwargs["headers"]["X-Api-Key"] - raise RuntimeError("passed") - - self.client.request = request - - try: - self.api.both_keys() - except RuntimeError as e: - assert "passed" == str(e) - - def test_key_in_header(self): - """Test case for key_in_header - - Use API key in header # noqa: E501 - """ - - def request(*args, **kwargs): - assert ("api_key", "SECRET_VALUE") not in kwargs["query_params"] - assert "PREFIX SECRET_VALUE" == kwargs["headers"]["X-Api-Key"] - raise RuntimeError("passed") - - self.client.request = request - - try: - self.api.key_in_header() - except RuntimeError as e: - assert "passed" == str(e) - - def test_key_in_query(self): - """Test case for key_in_query - - Use API key in query # noqa: E501 - """ - - def request(*args, **kwargs): - assert ("api_key", "SECRET_VALUE") in kwargs["query_params"] - assert "X-Api-Key" not in kwargs["headers"] - raise RuntimeError("passed") - - self.client.request = request - - try: - self.api.key_in_query() - except RuntimeError as e: - assert "passed" == str(e) - - -if __name__ == "__main__": - unittest.main() diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini deleted file mode 100644 index 64885ad1bbc9..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py deleted file mode 100644 index 844c2259fda5..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# flake8: noqa - -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from x_auth_id_alias.api_client import ApiClient - -# import Configuration -from x_auth_id_alias.configuration import Configuration - -# import exceptions -from x_auth_id_alias.exceptions import OpenApiException -from x_auth_id_alias.exceptions import ApiAttributeError -from x_auth_id_alias.exceptions import ApiTypeError -from x_auth_id_alias.exceptions import ApiValueError -from x_auth_id_alias.exceptions import ApiKeyError -from x_auth_id_alias.exceptions import ApiException diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py deleted file mode 100644 index d5440bc81484..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from x_auth_id_alias.apis import UsageApi diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py deleted file mode 100644 index 7307adb01c07..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py +++ /dev/null @@ -1,527 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from x_auth_id_alias.api_client import ApiClient, Endpoint as _Endpoint -from x_auth_id_alias.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) - - -class UsageApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.any_key_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'api_key', - 'api_key_query' - ], - 'endpoint_path': '/any', - 'operation_id': 'any_key', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.both_keys_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'api_key', - 'api_key_query' - ], - 'endpoint_path': '/both', - 'operation_id': 'both_keys', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.key_in_header_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/header', - 'operation_id': 'key_in_header', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.key_in_query_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/query', - 'operation_id': 'key_in_query', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - - def any_key( - self, - **kwargs - ): - """Use any API key # noqa: E501 - - Use any API key # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.any_key(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.any_key_endpoint.call_with_http_info(**kwargs) - - def both_keys( - self, - **kwargs - ): - """Use both API keys # noqa: E501 - - Use both API keys # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.both_keys(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.both_keys_endpoint.call_with_http_info(**kwargs) - - def key_in_header( - self, - **kwargs - ): - """Use API key in header # noqa: E501 - - Use API key in header # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_header(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.key_in_header_endpoint.call_with_http_info(**kwargs) - - def key_in_query( - self, - **kwargs - ): - """Use API key in query # noqa: E501 - - Use API key in query # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_query(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.key_in_query_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py deleted file mode 100644 index 2a0b44625212..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py +++ /dev/null @@ -1,898 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField - - -from x_auth_id_alias import rest -from x_auth_id_alias.configuration import Configuration -from x_auth_id_alias.exceptions import ApiTypeError, ApiValueError, ApiException -from x_auth_id_alias.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return (return_data) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, list): - return [cls.sanitize_for_serialization(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(cls.sanitize_for_serialization(item) for item in obj) - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - 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'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = UsageApi() - api_instance.any_key # this is an instance of the class Endpoint - api_instance.any_key() # this invokes api_instance.any_key.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.any_key.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] - ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py deleted file mode 100644 index f3c051339da4..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from x_auth_id_alias.api.usage_api import UsageApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from x_auth_id_alias.api.usage_api import UsageApi diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py deleted file mode 100644 index 24223a817292..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py +++ /dev/null @@ -1,522 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from x_auth_id_alias.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = x_auth_id_alias.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("x_auth_id_alias") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'X-Api-Key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key or 'api_key' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - alias='api_key', - ), - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://{server}.swagger.io:{port}/v2", - 'description': "petstore server", - 'variables': { - 'server': { - 'description': "No description provided", - 'default_value': "petstore", - 'enum_values': [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - 'port': { - 'description': "No description provided", - 'default_value': "80", - 'enum_values': [ - "80", - "8080" - ] - } - } - }, - { - 'url': "https://localhost:8080/{version}", - 'description': "The local server", - 'variables': { - 'version': { - 'description': "No description provided", - 'default_value': "v2", - 'enum_values': [ - "v1", - "v2" - ] - } - } - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py deleted file mode 100644 index e75ebdd4e1f2..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py +++ /dev/null @@ -1,158 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py deleted file mode 100644 index 7462dab04eeb..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# 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 x_auth_id_alias.models import ModelA, ModelB diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py deleted file mode 100644 index d90e2383d881..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py +++ /dev/null @@ -1,2058 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from x_auth_id_alias.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - 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 variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - 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 variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - 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: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - 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( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py deleted file mode 100644 index a7f55b975995..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from x_auth_id_alias.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py deleted file mode 100644 index 6f46b3f8e845..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - OpenAPI Extension x-auth-id-alias - - This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re -import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment -import urllib3 -import ipaddress - -from x_auth_id_alias.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.gitignore b/samples/openapi3/client/petstore/python-legacy/.gitignore deleted file mode 100755 index 43995bd42fa2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml deleted file mode 100755 index 142ce3712ed0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.gitlab-ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.nosetest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest - image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest - image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest - image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest - image: python:3.8-alpine diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore deleted file mode 100755 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES deleted file mode 100755 index c362f355b01b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES +++ /dev/null @@ -1,128 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesClass.md -docs/AllOfWithSingleRef.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/DefaultApi.md -docs/DeprecatedObject.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FooGetDefaultResponse.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Name.md -docs/NullableClass.md -docs/NumberOnly.md -docs/ObjectWithDeprecatedFields.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/OuterObjectWithEnumProperty.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SingleRefType.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/default_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/models/__init__.py -petstore_api/models/additional_properties_class.py -petstore_api/models/all_of_with_single_ref.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/deprecated_object.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/foo.py -petstore_api/models/foo_get_default_response.py -petstore_api/models/format_test.py -petstore_api/models/has_only_read_only.py -petstore_api/models/health_check_result.py -petstore_api/models/list.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/nullable_class.py -petstore_api/models/number_only.py -petstore_api/models/object_with_deprecated_fields.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/outer_enum_default_value.py -petstore_api/models/outer_enum_integer.py -petstore_api/models/outer_enum_integer_default_value.py -petstore_api/models/outer_object_with_enum_property.py -petstore_api/models/pet.py -petstore_api/models/read_only_first.py -petstore_api/models/single_ref_type.py -petstore_api/models/special_model_name.py -petstore_api/models/tag.py -petstore_api/models/user.py -petstore_api/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION deleted file mode 100755 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.travis.yml b/samples/openapi3/client/petstore/python-legacy/.travis.yml deleted file mode 100755 index fcd7e31c7ccf..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python-legacy/Makefile b/samples/openapi3/client/petstore/python-legacy/Makefile deleted file mode 100755 index ba5c5e73c63c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/Makefile +++ /dev/null @@ -1,21 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh diff --git a/samples/openapi3/client/petstore/python-legacy/README.md b/samples/openapi3/client/petstore/python-legacy/README.md deleted file mode 100755 index 1789a2a2c609..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/README.md +++ /dev/null @@ -1,227 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen - -## Requirements. - -Python 2.7 and 3.4+ - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -from __future__ import print_function -import datetime -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - client = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | -*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | -*FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [DeprecatedObject](docs/DeprecatedObject.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NumberOnly](docs/NumberOnly.md) - - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SingleRefType](docs/SingleRefType.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [User](docs/User.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -### bearer_test - -- **Type**: Bearer authentication (JWT) - - -### http_signature_test - - - -## Author - - - - diff --git a/samples/openapi3/client/petstore/python-legacy/dev-requirements.txt b/samples/openapi3/client/petstore/python-legacy/dev-requirements.txt deleted file mode 100755 index ccdfca629494..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md deleted file mode 100755 index d08ea901b622..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **dict[str, str]** | | [optional] -**map_of_map_property** | **dict[str, dict[str, str]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-legacy/docs/AllOfWithSingleRef.md deleted file mode 100644 index 2867f81fde0d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/AllOfWithSingleRef.md +++ /dev/null @@ -1,12 +0,0 @@ -# AllOfWithSingleRef - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | | [optional] -**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Animal.md b/samples/openapi3/client/petstore/python-legacy/docs/Animal.md deleted file mode 100755 index 8bc43ab53f33..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md deleted file mode 100755 index ecd52ad7705d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/AnotherFakeApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - client = petstore_api.Client() # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) - except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md deleted file mode 100755 index 81a7d0d85227..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100755 index b53b6cdb8c46..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **list[list[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md deleted file mode 100755 index 6116bc7489fd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **list[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md deleted file mode 100755 index 81420a3b9bbb..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **list[str]** | | [optional] -**array_array_of_integer** | **list[list[int]]** | | [optional] -**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md b/samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md deleted file mode 100755 index 1ddeadeb3f46..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Cat.md b/samples/openapi3/client/petstore/python-legacy/docs/Cat.md deleted file mode 100755 index b3eff72b3095..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Cat.md +++ /dev/null @@ -1,11 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md deleted file mode 100755 index 0ff7809a99ac..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Category.md b/samples/openapi3/client/petstore/python-legacy/docs/Category.md deleted file mode 100755 index 095459c80b65..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md b/samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md deleted file mode 100755 index 48ed7cbf2ff0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ClassModel.md +++ /dev/null @@ -1,12 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Client.md b/samples/openapi3/client/petstore/python-legacy/docs/Client.md deleted file mode 100755 index c3986008d6c3..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md deleted file mode 100755 index 151e354947c1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/DefaultApi.md +++ /dev/null @@ -1,64 +0,0 @@ -# petstore_api.DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | - - -# **foo_get** -> FooGetDefaultResponse foo_get() - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.DefaultApi(api_client) - - try: - api_response = api_instance.foo_get() - pprint(api_response) - except ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FooGetDefaultResponse**](FooGetDefaultResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | response | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-legacy/docs/DeprecatedObject.md deleted file mode 100644 index f381cf8bf87b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/DeprecatedObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeprecatedObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Dog.md b/samples/openapi3/client/petstore/python-legacy/docs/Dog.md deleted file mode 100755 index 7eeaf5b68515..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Dog.md +++ /dev/null @@ -1,11 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md deleted file mode 100755 index 6382bbd80671..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md deleted file mode 100755 index 92de0e955650..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md deleted file mode 100755 index 64830e3d1dee..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md b/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md deleted file mode 100755 index 46b320fbe45e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/EnumTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **str** | | [optional] -**enum_string_required** | **str** | | -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md deleted file mode 100755 index f8396a5d1f9d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ /dev/null @@ -1,1209 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | -[**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | - - -# **fake_health_get** -> HealthCheckResult fake_health_get() - -Health check endpoint - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - - try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_http_signature_test** -> fake_http_signature_test(pet, query_1=query_1, header_1=header_1) - -test http signature authentication - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -query_1 = 'query_1_example' # str | query parameter (optional) -header_1 = 'header_1_example' # str | header parameter (optional) - - try: - # test http signature authentication - api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1) - except ApiException as e: - print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query_1** | **str**| query parameter | [optional] - **header_1** | **str**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize(body=body) - - - -Test serialization of outer boolean types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite) - - - -Test serialization of object with outer number type - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) - - try: - api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_number_serialize** -> float fake_outer_number_serialize(body=body) - - - -Test serialization of outer number types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 3.4 # float | Input number as post body (optional) - - try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_outer_string_serialize** -> str fake_outer_string_serialize(body=body) - - - -Test serialization of outer string types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) - - try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_property_enum_integer_serialize** -> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property) - - - -Test serialization of enum (int) properties with examples - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body - - try: - api_response = api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | - -### Return type - -[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output enum (int) | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_binary** -> test_body_with_binary(body) - - - -For this test, the body has to be a binary file. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = '/path/to/file' # file | image to upload - - try: - api_instance.test_body_with_binary(body) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **file**| image to upload | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: image/png - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request must reference a schema named `File`. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | - - try: - api_instance.test_body_with_file_schema(file_schema_test_class) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, user) - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - query = 'query_example' # str | -user = petstore_api.User() # User | - - try: - api_instance.test_body_with_query_params(query, user) - except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - client = petstore_api.Client() # Client | client model - - try: - # To test \"client\" model - api_response = api_instance.test_client_model(client) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) -int32 = 56 # int | None (optional) -int64 = 56 # int | None (optional) -float = 3.4 # float | None (optional) -string = 'string_example' # str | None (optional) -binary = '/path/to/file' # file | None (optional) -date = '2013-10-20' # date | None (optional) -date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) -password = 'password_example' # str | None (optional) -param_callback = 'param_callback_example' # str | None (optional) - - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_query_model_array=enum_query_model_array, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - -To test enum parameters - -To test enum parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') -enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') -enum_query_integer = 56 # int | Query parameter enum test (double) (optional) -enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_query_model_array = [petstore_api.EnumClass()] # list[EnumClass] | (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') - - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_query_model_array=enum_query_model_array, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_query_model_array** | [**list[EnumClass]**](EnumClass.md)| | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -* Bearer (JWT) Authentication (bearer_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization (JWT): bearer_test -configuration = petstore_api.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) -boolean_group = True # bool | Boolean in group parameters (optional) -int64_group = 56 # int | Integer in group parameters (optional) - - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(request_body) - -test inline additionalProperties - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - request_body = {'key': 'request_body_example'} # dict[str, str] | request body - - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) - except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | [**dict[str, str]**](str.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) - - - -To test the collection format in query parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - pipe = ['pipe_example'] # list[str] | -ioutil = ['ioutil_example'] # list[str] | -http = ['http_example'] # list[str] | -url = ['url_example'] # list[str] | -context = ['context_example'] # list[str] | -allow_empty = 'allow_empty_example' # str | -language = {'key': 'language_example'} # dict[str, str] | (optional) - - try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) - except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**list[str]**](str.md)| | - **ioutil** | [**list[str]**](str.md)| | - **http** | [**list[str]**](str.md)| | - **url** | [**list[str]**](str.md)| | - **context** | [**list[str]**](str.md)| | - **allow_empty** | **str**| | - **language** | [**dict[str, str]**](str.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md deleted file mode 100755 index 1b02ad93eff6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,82 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - client = petstore_api.Client() # Client | client model - - try: - # To test class name in snake case - api_response = api_instance.test_classname(client) - pprint(api_response) - except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/File.md b/samples/openapi3/client/petstore/python-legacy/docs/File.md deleted file mode 100755 index 63b1d1a65186..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/File.md +++ /dev/null @@ -1,12 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md deleted file mode 100755 index 58d71b7a26be..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**list[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Foo.md b/samples/openapi3/client/petstore/python-legacy/docs/Foo.md deleted file mode 100755 index 258a8444fd4d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Foo.md +++ /dev/null @@ -1,11 +0,0 @@ -# Foo - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [default to 'bar'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-legacy/docs/FooGetDefaultResponse.md deleted file mode 100644 index 6c8095c9a39a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/FooGetDefaultResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# FooGetDefaultResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md b/samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md deleted file mode 100755 index 971997b5ec50..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/FormatTest.md +++ /dev/null @@ -1,26 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **float** | | -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**decimal** | [**Decimal**](Decimal.md) | | [optional] -**string** | **str** | | [optional] -**byte** | **str** | | -**binary** | **file** | | [optional] -**date** | **date** | | -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**password** | **str** | | -**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md deleted file mode 100755 index 0e1334519a8b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md deleted file mode 100755 index a8df56c8fafc..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/HealthCheckResult.md +++ /dev/null @@ -1,12 +0,0 @@ -# HealthCheckResult - -Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullable_message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md deleted file mode 100755 index f567ea188ce0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Updated name of the pet | [optional] -**status** | **str** | Updated status of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md deleted file mode 100755 index 42d38efa3013..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **str** | Additional data to pass to server | [optional] -**file** | **file** | file to upload | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md deleted file mode 100755 index 9bfba12f6f15..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject2.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md deleted file mode 100755 index ef9845fcd9c6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject3.md +++ /dev/null @@ -1,23 +0,0 @@ -# InlineObject3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | None | [optional] -**int32** | **int** | None | [optional] -**int64** | **int** | None | [optional] -**number** | **float** | None | -**float** | **float** | None | [optional] -**double** | **float** | None | -**string** | **str** | None | [optional] -**pattern_without_delimiter** | **str** | None | -**byte** | **str** | None | -**binary** | **file** | None | [optional] -**date** | **date** | None | [optional] -**date_time** | **datetime** | None | [optional] -**password** | **str** | None | [optional] -**callback** | **str** | None | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md deleted file mode 100755 index 07574d0d0769..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject4.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject4 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **str** | field1 | -**param2** | **str** | field2 | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md deleted file mode 100755 index c4502f70f9c8..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineObject5.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **str** | Additional data to pass to server | [optional] -**required_file** | **file** | file to upload | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md deleted file mode 100755 index f0a52bc4639c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/InlineResponseDefault.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineResponseDefault - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/List.md b/samples/openapi3/client/petstore/python-legacy/docs/List.md deleted file mode 100755 index 4b60956971aa..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md b/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md deleted file mode 100755 index 8f136137b524..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional] -**map_of_enum_string** | **dict[str, str]** | | [optional] -**direct_map** | **dict[str, bool]** | | [optional] -**indirect_map** | **dict[str, bool]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100755 index 46fb6992509c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**dict[str, Animal]**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md b/samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md deleted file mode 100755 index c958bd4b33f8..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Model200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md deleted file mode 100755 index 043e9d466fab..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ModelReturn.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Model_200Response.md b/samples/openapi3/client/petstore/python-legacy/docs/Model_200Response.md deleted file mode 100644 index 4fd119d12515..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Model_200Response.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Model_Return.md b/samples/openapi3/client/petstore/python-legacy/docs/Model_Return.md deleted file mode 100644 index 674c441551b3..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Model_Return.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Name.md b/samples/openapi3/client/petstore/python-legacy/docs/Name.md deleted file mode 100755 index 3be719cdbfba..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Name.md +++ /dev/null @@ -1,15 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md b/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md deleted file mode 100755 index ef127e778e29..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md +++ /dev/null @@ -1,22 +0,0 @@ -# NullableClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer_prop** | **int** | | [optional] -**number_prop** | **float** | | [optional] -**boolean_prop** | **bool** | | [optional] -**string_prop** | **str** | | [optional] -**date_prop** | **date** | | [optional] -**datetime_prop** | **datetime** | | [optional] -**array_nullable_prop** | **list[object]** | | [optional] -**array_and_items_nullable_prop** | **list[object]** | | [optional] -**array_items_nullable** | **list[object]** | | [optional] -**object_nullable_prop** | **dict[str, object]** | | [optional] -**object_and_items_nullable_prop** | **dict[str, object]** | | [optional] -**object_items_nullable** | **dict[str, object]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md deleted file mode 100755 index 37195c5d8994..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-legacy/docs/ObjectWithDeprecatedFields.md deleted file mode 100644 index 690711d7cbfc..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ObjectWithDeprecatedFields.md +++ /dev/null @@ -1,14 +0,0 @@ -# ObjectWithDeprecatedFields - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**id** | **float** | | [optional] -**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Order.md b/samples/openapi3/client/petstore/python-legacy/docs/Order.md deleted file mode 100755 index f360fffe8149..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to False] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md deleted file mode 100755 index 31013673df73..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# OuterComposite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md deleted file mode 100755 index 4cb31437c7e2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md deleted file mode 100755 index 4a5ba6428d83..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumDefaultValue.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumDefaultValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md deleted file mode 100755 index fc84ec365851..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumInteger.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumInteger - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md deleted file mode 100755 index 0de4199a8401..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumIntegerDefaultValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-legacy/docs/OuterObjectWithEnumProperty.md deleted file mode 100644 index bca6ef5bc4c2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/OuterObjectWithEnumProperty.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterObjectWithEnumProperty - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Pet.md b/samples/openapi3/client/petstore/python-legacy/docs/Pet.md deleted file mode 100755 index c462e794c89a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **str** | | -**photo_urls** | **list[str]** | | -**tags** | [**list[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md deleted file mode 100755 index ff644b76a8e6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md +++ /dev/null @@ -1,694 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **add_pet** -> add_pet(pet) - -Add a new pet to the store - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Add a new pet to the store - api_instance.add_pet(pet) - except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id, api_key=api_key) - -Deletes a pet - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) - - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful operation | - | -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> list[Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - status = ['status_example'] # list[str] | Status values that need to be considered for filter - - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> list[Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - tags = ['tags_example'] # list[str] | Tags to filter by - - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**list[str]**](str.md)| Tags to filter by | - -### Return type - -[**list[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to return - - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(pet) - -Update an existing pet - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - - try: - # Update an existing pet - api_instance.update_pet(pet) - except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id, name=name, status=status) - -Updates a pet in the store with form data - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) -status = 'status_example' # str | Updated status of the pet (optional) - - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful operation | - | -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) - -uploads an image - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -file = '/path/to/file' # file | file to upload (optional) - - try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - -uploads an image (required) - - - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_id = 56 # int | ID of pet to update -required_file = '/path/to/file' # file | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - - try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) - except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md deleted file mode 100755 index 53b4c61d8445..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SingleRefType.md b/samples/openapi3/client/petstore/python-legacy/docs/SingleRefType.md deleted file mode 100644 index 4178ac3b505e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/SingleRefType.md +++ /dev/null @@ -1,10 +0,0 @@ -# SingleRefType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md deleted file mode 100755 index 268e1134192d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md deleted file mode 100755 index b4e6d409c836..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md +++ /dev/null @@ -1,270 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 'order_id_example' # str | ID of the order that needs to be deleted - - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> dict[str, int] get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**dict[str, int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_id = 56 # int | ID of pet that needs to be fetched - - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(order) - -Place an order for a pet - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order = petstore_api.Order() # Order | order placed for purchasing the pet - - try: - # Place an order for a pet - api_response = api_instance.place_order(order) - pprint(api_response) - except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/Tag.md b/samples/openapi3/client/petstore/python-legacy/docs/Tag.md deleted file mode 100755 index 4ccac4949afc..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/User.md b/samples/openapi3/client/petstore/python-legacy/docs/User.md deleted file mode 100755 index b0079f591b6e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md b/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md deleted file mode 100755 index f5ad4ab78fb9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md +++ /dev/null @@ -1,511 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user = petstore_api.User() # User | Created user object - - try: - # Create user - api_instance.create_user(user) - except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(user) - -Creates list of users with given input array - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(user) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(user) - -Creates list of users with given input array - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user = [petstore_api.User()] # list[User] | List of user object - - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(user) - except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**list[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be deleted - - try: - # Delete user - api_instance.delete_user(username) - except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - - try: - # Logs out current logged in user session - api_instance.logout_user() - except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - username = 'username_example' # str | name that need to be deleted -user = petstore_api.User() # User | Updated user object - - try: - # Updated user - api_instance.update_user(username, user) - except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-legacy/git_push.sh b/samples/openapi3/client/petstore/python-legacy/git_push.sh deleted file mode 100755 index f53a75d4fabe..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py deleted file mode 100755 index 68ec54c6b79a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - -# import ApiClient -from petstore_api.api_client import ApiClient -from petstore_api.configuration import Configuration -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiException -# import models into sdk package -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.deprecated_object import DeprecatedObject -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.foo import Foo -from petstore_api.models.foo_get_default_response import FooGetDefaultResponse -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.nullable_class import NullableClass -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.single_ref_type import SingleRefType -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.user import User - diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py deleted file mode 100755 index bc45197c40f0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py deleted file mode 100755 index 844e1507ee94..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def call_123_test_special_tags(self, client, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501 - - def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags_with_http_info(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'client' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method call_123_test_special_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'client' is set - if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `client` when calling `call_123_test_special_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'client' in local_var_params: - body_params = local_var_params['client'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py deleted file mode 100755 index 833a1e00fa7c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class DefaultApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def foo_get(self, **kwargs): # noqa: E501 - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.foo_get(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: FooGetDefaultResponse - """ - kwargs['_return_http_data_only'] = True - return self.foo_get_with_http_info(**kwargs) # noqa: E501 - - def foo_get_with_http_info(self, **kwargs): # noqa: E501 - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.foo_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(FooGetDefaultResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method foo_get" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - } - - return self.api_client.call_api( - '/foo', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py deleted file mode 100755 index bb41ebddd78d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2709 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def fake_health_get(self, **kwargs): # noqa: E501 - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_health_get(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: HealthCheckResult - """ - kwargs['_return_http_data_only'] = True - return self.fake_health_get_with_http_info(**kwargs) # noqa: E501 - - def fake_health_get_with_http_info(self, **kwargs): # noqa: E501 - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_health_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(HealthCheckResult, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_health_get" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "HealthCheckResult", - } - - return self.api_client.call_api( - '/fake/health', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_http_signature_test(self, pet, **kwargs): # noqa: E501 - """test http signature authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_http_signature_test(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param query_1: query parameter - :type query_1: str - :param header_1: header parameter - :type header_1: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.fake_http_signature_test_with_http_info(pet, **kwargs) # noqa: E501 - - def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 - """test http signature authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_http_signature_test_with_http_info(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param query_1: query parameter - :type query_1: str - :param header_1: header parameter - :type header_1: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet', - 'query_1', - 'header_1' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_http_signature_test" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query_1') is not None: # noqa: E501 - query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'header_1' in local_var_params: - header_params['header_1'] = local_var_params['header_1'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'pet' in local_var_params: - body_params = local_var_params['pet'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_signature_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/http-signature-test', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bool - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input boolean as post body - :type body: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_boolean_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "bool", - } - - return self.api_client.call_api( - '/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - :param outer_composite: Input composite as post body - :type outer_composite: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: OuterComposite - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param outer_composite: Input composite as post body - :type outer_composite: OuterComposite - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'outer_composite' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_composite_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'outer_composite' in local_var_params: - body_params = local_var_params['outer_composite'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "OuterComposite", - } - - return self.api_client.call_api( - '/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: float - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input number as post body - :type body: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_number_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "float", - } - - return self.api_client.call_api( - '/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - - def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - :param body: Input string as post body - :type body: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_string_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - } - - return self.api_client.call_api( - '/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def fake_property_enum_integer_serialize(self, outer_object_with_enum_property, **kwargs): # noqa: E501 - """fake_property_enum_integer_serialize # noqa: E501 - - Test serialization of enum (int) properties with examples # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_property_enum_integer_serialize(outer_object_with_enum_property, async_req=True) - >>> result = thread.get() - - :param outer_object_with_enum_property: Input enum (int) as post body (required) - :type outer_object_with_enum_property: OuterObjectWithEnumProperty - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: OuterObjectWithEnumProperty - """ - kwargs['_return_http_data_only'] = True - return self.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, **kwargs) # noqa: E501 - - def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_enum_property, **kwargs): # noqa: E501 - """fake_property_enum_integer_serialize # noqa: E501 - - Test serialization of enum (int) properties with examples # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, async_req=True) - >>> result = thread.get() - - :param outer_object_with_enum_property: Input enum (int) as post body (required) - :type outer_object_with_enum_property: OuterObjectWithEnumProperty - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(OuterObjectWithEnumProperty, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'outer_object_with_enum_property' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_property_enum_integer_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'outer_object_with_enum_property' is set - if self.api_client.client_side_validation and local_var_params.get('outer_object_with_enum_property') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `outer_object_with_enum_property` when calling `fake_property_enum_integer_serialize`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'outer_object_with_enum_property' in local_var_params: - body_params = local_var_params['outer_object_with_enum_property'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "OuterObjectWithEnumProperty", - } - - return self.api_client.call_api( - '/fake/property/enum-int', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_binary(self, body, **kwargs): # noqa: E501 - """test_body_with_binary # noqa: E501 - - For this test, the body has to be a binary file. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_binary(body, async_req=True) - >>> result = thread.get() - - :param body: image to upload (required) - :type body: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_binary_with_http_info(body, **kwargs) # noqa: E501 - - def test_body_with_binary_with_http_info(self, body, **kwargs): # noqa: E501 - """test_body_with_binary # noqa: E501 - - For this test, the body has to be a binary file. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_binary_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param body: image to upload (required) - :type body: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_binary" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['image/png'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-binary', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request must reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) - >>> result = thread.get() - - :param file_schema_test_class: (required) - :type file_schema_test_class: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501 - - def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request must reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True) - >>> result = thread.get() - - :param file_schema_test_class: (required) - :type file_schema_test_class: FileSchemaTestClass - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'file_schema_test_class' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_file_schema" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'file_schema_test_class' is set - if self.api_client.client_side_validation and local_var_params.get('file_schema_test_class') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `file_schema_test_class` when calling `test_body_with_file_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'file_schema_test_class' in local_var_params: - body_params = local_var_params['file_schema_test_class'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-file-schema', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_body_with_query_params(self, query, user, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, user, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param user: (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501 - - def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True) - >>> result = thread.get() - - :param query: (required) - :type query: str - :param user: (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'query', - 'user' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_query_params" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query' is set - if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 - # verify the required parameter 'user' is set - if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `user` when calling `test_body_with_query_params`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('query') is not None: # noqa: E501 - query_params.append(('query', local_var_params['query'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/body-with-query-params', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_client_model(self, client, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501 - - def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model_with_http_info(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'client' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_client_model" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'client' is set - if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `client` when calling `test_client_model`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'client' in local_var_params: - body_params = local_var_params['client'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param number: None (required) - :type number: float - :param double: None (required) - :type double: float - :param pattern_without_delimiter: None (required) - :type pattern_without_delimiter: str - :param byte: None (required) - :type byte: str - :param integer: None - :type integer: int - :param int32: None - :type int32: int - :param int64: None - :type int64: int - :param float: None - :type float: float - :param string: None - :type string: str - :param binary: None - :type binary: file - :param date: None - :type date: date - :param date_time: None - :type date_time: datetime - :param password: None - :type password: str - :param param_callback: None - :type param_callback: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'number' is set - if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'double' is set - if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 - raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 - raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) > 64): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 - len(local_var_params['password']) < 10): # noqa: E501 - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'integer' in local_var_params: - form_params.append(('integer', local_var_params['integer'])) # noqa: E501 - if 'int32' in local_var_params: - form_params.append(('int32', local_var_params['int32'])) # noqa: E501 - if 'int64' in local_var_params: - form_params.append(('int64', local_var_params['int64'])) # noqa: E501 - if 'number' in local_var_params: - form_params.append(('number', local_var_params['number'])) # noqa: E501 - if 'float' in local_var_params: - form_params.append(('float', local_var_params['float'])) # noqa: E501 - if 'double' in local_var_params: - form_params.append(('double', local_var_params['double'])) # noqa: E501 - if 'string' in local_var_params: - form_params.append(('string', local_var_params['string'])) # noqa: E501 - if 'pattern_without_delimiter' in local_var_params: - form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 - if 'byte' in local_var_params: - form_params.append(('byte', local_var_params['byte'])) # noqa: E501 - if 'binary' in local_var_params: - local_var_files['binary'] = local_var_params['binary'] # noqa: E501 - if 'date' in local_var_params: - form_params.append(('date', local_var_params['date'])) # noqa: E501 - if 'date_time' in local_var_params: - form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 - if 'password' in local_var_params: - form_params.append(('password', local_var_params['password'])) # noqa: E501 - if 'param_callback' in local_var_params: - form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['http_basic_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_query_model_array: - :type enum_query_model_array: list[EnumClass] - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - - def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters_with_http_info(async_req=True) - >>> result = thread.get() - - :param enum_header_string_array: Header parameter enum test (string array) - :type enum_header_string_array: list[str] - :param enum_header_string: Header parameter enum test (string) - :type enum_header_string: str - :param enum_query_string_array: Query parameter enum test (string array) - :type enum_query_string_array: list[str] - :param enum_query_string: Query parameter enum test (string) - :type enum_query_string: str - :param enum_query_integer: Query parameter enum test (double) - :type enum_query_integer: int - :param enum_query_double: Query parameter enum test (double) - :type enum_query_double: float - :param enum_query_model_array: - :type enum_query_model_array: list[EnumClass] - :param enum_form_string_array: Form parameter enum test (string array) - :type enum_form_string_array: list[str] - :param enum_form_string: Form parameter enum test (string) - :type enum_form_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_query_model_array', - 'enum_form_string_array', - 'enum_form_string' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_enum_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 - query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 - collection_formats['enum_query_string_array'] = 'multi' # noqa: E501 - if local_var_params.get('enum_query_string') is not None: # noqa: E501 - query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if local_var_params.get('enum_query_integer') is not None: # noqa: E501 - query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if local_var_params.get('enum_query_double') is not None: # noqa: E501 - query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - if local_var_params.get('enum_query_model_array') is not None: # noqa: E501 - query_params.append(('enum_query_model_array', local_var_params['enum_query_model_array'])) # noqa: E501 - collection_formats['enum_query_model_array'] = 'multi' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'enum_header_string_array' in local_var_params: - header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 - collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 - if 'enum_header_string' in local_var_params: - header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 - - form_params = [] - local_var_files = {} - if 'enum_form_string_array' in local_var_params: - form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 - collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 - if 'enum_form_string' in local_var_params: - form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - - def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param required_string_group: Required String in group parameters (required) - :type required_string_group: int - :param required_boolean_group: Required Boolean in group parameters (required) - :type required_boolean_group: bool - :param required_int64_group: Required Integer in group parameters (required) - :type required_int64_group: int - :param string_group: String in group parameters - :type string_group: int - :param boolean_group: Boolean in group parameters - :type boolean_group: bool - :param int64_group: Integer in group parameters - :type int64_group: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_group_parameters" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('required_string_group') is not None: # noqa: E501 - query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if local_var_params.get('required_int64_group') is not None: # noqa: E501 - query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if local_var_params.get('string_group') is not None: # noqa: E501 - query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if local_var_params.get('int64_group') is not None: # noqa: E501 - query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - if 'required_boolean_group' in local_var_params: - header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 - if 'boolean_group' in local_var_params: - header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['bearer_test'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(request_body, async_req=True) - >>> result = thread.get() - - :param request_body: request body (required) - :type request_body: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501 - - def test_inline_additional_properties_with_http_info(self, request_body, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True) - >>> result = thread.get() - - :param request_body: request body (required) - :type request_body: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'request_body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_inline_additional_properties" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'request_body' is set - if self.api_client.client_side_validation and local_var_params.get('request_body') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `request_body` when calling `test_inline_additional_properties`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'request_body' in local_var_params: - body_params = local_var_params['request_body'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - - def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) - >>> result = thread.get() - - :param param: field1 (required) - :type param: str - :param param2: field2 (required) - :type param2: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'param', - 'param2' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_json_form_data" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 - # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'param' in local_var_params: - form_params.append(('param', local_var_params['param'])) # noqa: E501 - if 'param2' in local_var_params: - form_params.append(('param2', local_var_params['param2'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'GET', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param allow_empty: (required) - :type allow_empty: str - :param language: - :type language: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, **kwargs) # noqa: E501 - - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, async_req=True) - >>> result = thread.get() - - :param pipe: (required) - :type pipe: list[str] - :param ioutil: (required) - :type ioutil: list[str] - :param http: (required) - :type http: list[str] - :param url: (required) - :type url: list[str] - :param context: (required) - :type context: list[str] - :param allow_empty: (required) - :type allow_empty: str - :param language: - :type language: dict[str, str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context', - 'allow_empty', - 'language' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_query_parameter_collection_format" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'http' is set - if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'url' is set - if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'context' is set - if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 - # verify the required parameter 'allow_empty' is set - if self.api_client.client_side_validation and local_var_params.get('allow_empty') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `allow_empty` when calling `test_query_parameter_collection_format`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('pipe') is not None: # noqa: E501 - query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 - collection_formats['pipe'] = 'pipes' # noqa: E501 - if local_var_params.get('ioutil') is not None: # noqa: E501 - query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 - collection_formats['ioutil'] = 'csv' # noqa: E501 - if local_var_params.get('http') is not None: # noqa: E501 - query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 - if local_var_params.get('url') is not None: # noqa: E501 - query_params.append(('url', local_var_params['url'])) # noqa: E501 - collection_formats['url'] = 'csv' # noqa: E501 - if local_var_params.get('context') is not None: # noqa: E501 - query_params.append(('context', local_var_params['context'])) # noqa: E501 - collection_formats['context'] = 'multi' # noqa: E501 - if local_var_params.get('language') is not None: # noqa: E501 - query_params.append(('language', local_var_params['language'])) # noqa: E501 - if local_var_params.get('allow_empty') is not None: # noqa: E501 - query_params.append(('allowEmpty', local_var_params['allow_empty'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/fake/test-query-parameters', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index 4bc981fb8871..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, client, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(client, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'client' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'client' is set - if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'client' in local_var_params: - body_params = local_var_params['client'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100755 index 05c1c8a0e4ff..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, client, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Client - """ - kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(client, **kwargs) # noqa: E501 - - def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname_with_http_info(client, async_req=True) - >>> result = thread.get() - - :param client: client model (required) - :type client: Client - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'client' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'client' is set - if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 - local_var_params['client'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'client' in local_var_params: - body_params = local_var_params['client'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PATCH', body_params)) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 - - response_types_map = { - 200: "Client", - } - - return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py deleted file mode 100755 index 14cf58697c06..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1374 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_pet(self, pet, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501 - - def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet_with_http_info(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_hosts = [ - 'http://petstore.swagger.io/v2', - 'http://path-server-test.petstore.local/v2', - 'http://{server}.swagger.io:{port}/v2' - ] - local_var_host = local_var_hosts[0] - if kwargs.get('_host_index'): - _host_index = int(kwargs.get('_host_index')) - if _host_index < 0 or _host_index >= len(local_var_hosts): - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" - % len(local_var_host) - ) - local_var_host = local_var_hosts[_host_index] - local_var_params = locals() - - all_params = [ - 'pet' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params and key != "_host_index": - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet` when calling `add_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'pet' in local_var_params: - body_params = local_var_params['pet'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - _host=local_var_host, - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - - def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: Pet id to delete (required) - :type pet_id: int - :param api_key: - :type api_key: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'api_key' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - if 'api_key' in local_var_params: - header_params['api_key'] = local_var_params['api_key'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - - def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) - >>> result = thread.get() - - :param status: Status values that need to be considered for filter (required) - :type status: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_status" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('status') is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 - collection_formats['status'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: list[Pet] - """ - kwargs['_return_http_data_only'] = True - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - - def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) - >>> result = thread.get() - - :param tags: Tags to filter by (required) - :type tags: list[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'tags' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('tags') is not None: # noqa: E501 - query_params.append(('tags', local_var_params['tags'])) # noqa: E501 - collection_formats['tags'] = 'csv' # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "list[Pet]", - 400: None, - } - - return self.api_client.call_api( - '/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Pet - """ - kwargs['_return_http_data_only'] = True - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to return (required) - :type pet_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "Pet", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet(self, pet, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501 - - def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_http_info(pet, async_req=True) - >>> result = thread.get() - - :param pet: Pet object that needs to be added to the store (required) - :type pet: Pet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_hosts = [ - 'http://petstore.swagger.io/v2', - 'http://path-server-test.petstore.local/v2', - 'http://{server}.swagger.io:{port}/v2' - ] - local_var_host = local_var_hosts[0] - if kwargs.get('_host_index'): - _host_index = int(kwargs.get('_host_index')) - if _host_index < 0 or _host_index >= len(local_var_hosts): - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" - % len(local_var_host) - ) - local_var_host = local_var_hosts[_host_index] - local_var_params = locals() - - all_params = [ - 'pet' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params and key != "_host_index": - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet` when calling `update_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'pet' in local_var_params: - body_params = local_var_params['pet'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/xml'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - _host=local_var_host, - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet that needs to be updated (required) - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'name', - 'status' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet_with_form" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'name' in local_var_params: - form_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'status' in local_var_params: - form_params.append(('status', local_var_params['status'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/x-www-form-urlencoded'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 - - def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: file - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'additional_metadata', - 'file' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ApiResponse - """ - kwargs['_return_http_data_only'] = True - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - - def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param pet_id: ID of pet to update (required) - :type pet_id: int - :param required_file: file to upload (required) - :type required_file: file - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'pet_id', - 'required_file', - 'additional_metadata' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file_with_required_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 - # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'required_file' in local_var_params: - local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - response_types_map = { - 200: "ApiResponse", - } - - return self.api_client.call_api( - '/fake/{petId}/uploadImageWithRequiredFile', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py deleted file mode 100755 index 60655c93e34d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py +++ /dev/null @@ -1,584 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - - def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of the order that needs to be deleted (required) - :type order_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: dict[str, int] - """ - kwargs['_return_http_data_only'] = True - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 - - def get_inventory_with_http_info(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_inventory" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - response_types_map = { - 200: "dict[str, int]", - } - - return self.api_client.call_api( - '/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - - def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - :param order_id: ID of pet that needs to be fetched (required) - :type order_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'order_id' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_order_by_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def place_order(self, order, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(order, async_req=True) - >>> result = thread.get() - - :param order: order placed for purchasing the pet (required) - :type order: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Order - """ - kwargs['_return_http_data_only'] = True - return self.place_order_with_http_info(order, **kwargs) # noqa: E501 - - def place_order_with_http_info(self, order, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order_with_http_info(order, async_req=True) - >>> result = thread.get() - - :param order: order placed for purchasing the pet (required) - :type order: Order - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'order' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order' is set - if self.api_client.client_side_validation and local_var_params.get('order') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `order` when calling `place_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'order' in local_var_params: - body_params = local_var_params['order'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "Order", - 400: None, - } - - return self.api_client.call_api( - '/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py deleted file mode 100755 index 4e326c6a51fd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py +++ /dev/null @@ -1,1142 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_user(self, user, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(user, async_req=True) - >>> result = thread.get() - - :param user: Created user object (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_user_with_http_info(user, **kwargs) # noqa: E501 - - def create_user_with_http_info(self, user, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_with_http_info(user, async_req=True) - >>> result = thread.get() - - :param user: Created user object (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'user' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'user' is set - if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `user` when calling `create_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_array_input(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(user, async_req=True) - >>> result = thread.get() - - :param user: List of user object (required) - :type user: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501 - - def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True) - >>> result = thread.get() - - :param user: List of user object (required) - :type user: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'user' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_array_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'user' is set - if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_array_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_users_with_list_input(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(user, async_req=True) - >>> result = thread.get() - - :param user: List of user object (required) - :type user: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501 - - def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True) - >>> result = thread.get() - - :param user: List of user object (required) - :type user: list[User] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'user' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_list_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'user' is set - if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_list_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'POST', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - - def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be deleted (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - - def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) - >>> result = thread.get() - - :param username: The name that needs to be fetched. Use user1 for testing. (required) - :type username: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "User", - 400: None, - 404: None, - } - - return self.api_client.call_api( - '/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - - def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user_with_http_info(username, password, async_req=True) - >>> result = thread.get() - - :param username: The user name for login (required) - :type username: str - :param password: The password for login in clear text (required) - :type password: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'password' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 - # verify the required parameter 'password' is set - if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get('username') is not None: # noqa: E501 - query_params.append(('username', local_var_params['username'])) # noqa: E501 - if local_var_params.get('password') is not None: # noqa: E501 - query_params.append(('password', local_var_params['password'])) # noqa: E501 - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = { - 200: "str", - 400: None, - } - - return self.api_client.call_api( - '/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.logout_user_with_http_info(**kwargs) # noqa: E501 - - def logout_user_with_http_info(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_user(self, username, user, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, user, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param user: Updated user object (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501 - - def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_with_http_info(username, user, async_req=True) - >>> result = thread.get() - - :param username: name that need to be deleted (required) - :type username: str - :param user: Updated user object (required) - :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'username', - 'user' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 - # verify the required parameter 'user' is set - if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `user` when calling `update_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get('_headers', {})) - - form_params = [] - local_var_files = {} - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Content-Type` - content_types_list = local_var_params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'], - 'PUT', body_params)) # noqa: E501 - if content_types_list: - header_params['Content-Type'] = content_types_list - - # Authentication setting - auth_settings = [] # noqa: E501 - - response_types_map = {} - - return self.api_client.call_api( - '/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_types_map=response_types_map, - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py deleted file mode 100755 index 294f6f87c73c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py +++ /dev/null @@ -1,701 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote - -from petstore_api.configuration import Configuration -import petstore_api.models -from petstore_api import rest -from petstore_api.exceptions import ApiValueError, ApiException - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return return_data - - response_type = response_types_map.get(response_data.status, None) - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict['): - sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(petstore_api.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, queries, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) - - def _apply_auth_params(self, headers, queries, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - kwargs["local_vars_configuration"] = self.configuration - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py deleted file mode 100755 index c5c7990b6293..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/configuration.py +++ /dev/null @@ -1,625 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -import six -from six.moves import http_client as httplib -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of petstore_api.signing.HttpSigningConfiguration - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is because explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - signing_info=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = None - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - if name == "signing_info" and value is not None: - # Ensure the host parameter from signing info is the same as - # Configuration.host. - value.host = self.host - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - if self.access_token is not None: - auth['bearer_test'] = { - 'type': 'bearer', - 'in': 'header', - 'format': 'JWT', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if self.signing_info is not None: - auth['http_signature_test'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://{server}.swagger.io:{port}/v2", - 'description': "petstore server", - 'variables': { - 'server': { - 'description': "No description provided", - 'default_value': "petstore", - 'enum_values': [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - 'port': { - 'description': "No description provided", - 'default_value': "80", - 'enum_values': [ - "80", - "8080" - ] - } - } - }, - { - 'url': "https://localhost:8080/{version}", - 'description': "The local server", - 'variables': { - 'version': { - 'description': "No description provided", - 'default_value': "v2", - 'enum_values': [ - "v1", - "v2" - ] - } - } - }, - { - 'url': "https://127.0.0.1/no_varaible", - 'description': "The local server without variables", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py deleted file mode 100755 index 08181d4775db..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/exceptions.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py deleted file mode 100755 index 2b4432c9e36a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.deprecated_object import DeprecatedObject -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.foo import Foo -from petstore_api.models.foo_get_default_response import FooGetDefaultResponse -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.nullable_class import NullableClass -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.single_ref_type import SingleRefType -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.tag import Tag -from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py deleted file mode 100755 index 710807587e2f..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_property': 'dict[str, str]', - 'map_of_map_property': 'dict[str, dict[str, str]]' - } - - attribute_map = { - 'map_property': 'map_property', - 'map_of_map_property': 'map_of_map_property' - } - - def __init__(self, map_property=None, map_of_map_property=None, local_vars_configuration=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_property = None - self._map_of_map_property = None - self.discriminator = None - - if map_property is not None: - self.map_property = map_property - if map_of_map_property is not None: - self.map_of_map_property = map_of_map_property - - @property - def map_property(self): - """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_property of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_property - - @map_property.setter - def map_property(self, map_property): - """Sets the map_property of this AdditionalPropertiesClass. - - - :param map_property: The map_property of this AdditionalPropertiesClass. # noqa: E501 - :type map_property: dict[str, str] - """ - - self._map_property = map_property - - @property - def map_of_map_property(self): - """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - - - :return: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_of_map_property - - @map_of_map_property.setter - def map_of_map_property(self, map_of_map_property): - """Sets the map_of_map_property of this AdditionalPropertiesClass. - - - :param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - :type map_of_map_property: dict[str, dict[str, str]] - """ - - self._map_of_map_property = map_of_map_property - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/all_of_with_single_ref.py deleted file mode 100644 index e71b49de252b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/all_of_with_single_ref.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class AllOfWithSingleRef(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'username': 'str', - 'single_ref_type': 'SingleRefType' - } - - attribute_map = { - 'username': 'username', - 'single_ref_type': 'SingleRefType' - } - - def __init__(self, username=None, single_ref_type=None, local_vars_configuration=None): # noqa: E501 - """AllOfWithSingleRef - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._username = None - self._single_ref_type = None - self.discriminator = None - - if username is not None: - self.username = username - if single_ref_type is not None: - self.single_ref_type = single_ref_type - - @property - def username(self): - """Gets the username of this AllOfWithSingleRef. # noqa: E501 - - - :return: The username of this AllOfWithSingleRef. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this AllOfWithSingleRef. - - - :param username: The username of this AllOfWithSingleRef. # noqa: E501 - :type username: str - """ - - self._username = username - - @property - def single_ref_type(self): - """Gets the single_ref_type of this AllOfWithSingleRef. # noqa: E501 - - - :return: The single_ref_type of this AllOfWithSingleRef. # noqa: E501 - :rtype: SingleRefType - """ - return self._single_ref_type - - @single_ref_type.setter - def single_ref_type(self, single_ref_type): - """Sets the single_ref_type of this AllOfWithSingleRef. - - - :param single_ref_type: The single_ref_type of this AllOfWithSingleRef. # noqa: E501 - :type single_ref_type: SingleRefType - """ - - self._single_ref_type = single_ref_type - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AllOfWithSingleRef): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AllOfWithSingleRef): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py deleted file mode 100755 index d4a49534078d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Animal(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'class_name': 'str', - 'color': 'str' - } - - attribute_map = { - 'class_name': 'className', - 'color': 'color' - } - - discriminator_value_class_map = { - 'Cat': 'Cat', - 'Dog': 'Dog' - } - - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 - """Animal - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._class_name = None - self._color = None - self.discriminator = 'class_name' - - self.class_name = class_name - if color is not None: - self.color = color - - @property - def class_name(self): - """Gets the class_name of this Animal. # noqa: E501 - - - :return: The class_name of this Animal. # noqa: E501 - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """Sets the class_name of this Animal. - - - :param class_name: The class_name of this Animal. # noqa: E501 - :type class_name: str - """ - if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 - raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 - - self._class_name = class_name - - @property - def color(self): - """Gets the color of this Animal. # noqa: E501 - - - :return: The color of this Animal. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this Animal. - - - :param color: The color of this Animal. # noqa: E501 - :type color: str - """ - - self._color = color - - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Animal): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Animal): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py deleted file mode 100755 index bddac1eb10a3..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/api_response.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ApiResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str' - } - - attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } - - def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._type = None - self._message = None - self.discriminator = None - - if code is not None: - self.code = code - if type is not None: - self.type = type - if message is not None: - self.message = message - - @property - def code(self): - """Gets the code of this ApiResponse. # noqa: E501 - - - :return: The code of this ApiResponse. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this ApiResponse. - - - :param code: The code of this ApiResponse. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def type(self): - """Gets the type of this ApiResponse. # noqa: E501 - - - :return: The type of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this ApiResponse. - - - :param type: The type of this ApiResponse. # noqa: E501 - :type type: str - """ - - self._type = type - - @property - def message(self): - """Gets the message of this ApiResponse. # noqa: E501 - - - :return: The message of this ApiResponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this ApiResponse. - - - :param message: The message of this ApiResponse. # noqa: E501 - :type message: str - """ - - self._message = message - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ApiResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ApiResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py deleted file mode 100755 index 2975adc20e31..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_array_number': 'list[list[float]]' - } - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber' - } - - def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_array_number = None - self.discriminator = None - - if array_array_number is not None: - self.array_array_number = array_array_number - - @property - def array_array_number(self): - """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - - - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :rtype: list[list[float]] - """ - return self._array_array_number - - @array_array_number.setter - def array_array_number(self, array_array_number): - """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. - - - :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :type array_array_number: list[list[float]] - """ - - self._array_array_number = array_array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py deleted file mode 100755 index 2a3400e76660..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_of_number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayOfNumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_number': 'list[float]' - } - - attribute_map = { - 'array_number': 'ArrayNumber' - } - - def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_number = None - self.discriminator = None - - if array_number is not None: - self.array_number = array_number - - @property - def array_number(self): - """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - - - :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :rtype: list[float] - """ - return self._array_number - - @array_number.setter - def array_number(self, array_number): - """Sets the array_number of this ArrayOfNumberOnly. - - - :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 - :type array_number: list[float] - """ - - self._array_number = array_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfNumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayOfNumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py deleted file mode 100755 index 5501a637f633..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/array_test.py +++ /dev/null @@ -1,189 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ArrayTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' - } - - attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' - } - - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._array_of_string = None - self._array_array_of_integer = None - self._array_array_of_model = None - self.discriminator = None - - if array_of_string is not None: - self.array_of_string = array_of_string - if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer - if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model - - @property - def array_of_string(self): - """Gets the array_of_string of this ArrayTest. # noqa: E501 - - - :return: The array_of_string of this ArrayTest. # noqa: E501 - :rtype: list[str] - """ - return self._array_of_string - - @array_of_string.setter - def array_of_string(self, array_of_string): - """Sets the array_of_string of this ArrayTest. - - - :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 - :type array_of_string: list[str] - """ - if (self.local_vars_configuration.client_side_validation and - array_of_string is not None and len(array_of_string) > 3): - raise ValueError("Invalid value for `array_of_string`, number of items must be less than or equal to `3`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - array_of_string is not None and len(array_of_string) < 0): - raise ValueError("Invalid value for `array_of_string`, number of items must be greater than or equal to `0`") # noqa: E501 - - self._array_of_string = array_of_string - - @property - def array_array_of_integer(self): - """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_integer of this ArrayTest. # noqa: E501 - :rtype: list[list[int]] - """ - return self._array_array_of_integer - - @array_array_of_integer.setter - def array_array_of_integer(self, array_array_of_integer): - """Sets the array_array_of_integer of this ArrayTest. - - - :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 - :type array_array_of_integer: list[list[int]] - """ - - self._array_array_of_integer = array_array_of_integer - - @property - def array_array_of_model(self): - """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - - - :return: The array_array_of_model of this ArrayTest. # noqa: E501 - :rtype: list[list[ReadOnlyFirst]] - """ - return self._array_array_of_model - - @array_array_of_model.setter - def array_array_of_model(self, array_array_of_model): - """Sets the array_array_of_model of this ArrayTest. - - - :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 - :type array_array_of_model: list[list[ReadOnlyFirst]] - """ - - self._array_array_of_model = array_array_of_model - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ArrayTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py deleted file mode 100755 index cb8b0d985842..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/capitalization.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Capitalization(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str' - } - - attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' - } - - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._small_camel = None - self._capital_camel = None - self._small_snake = None - self._capital_snake = None - self._sca_eth_flow_points = None - self._att_name = None - self.discriminator = None - - if small_camel is not None: - self.small_camel = small_camel - if capital_camel is not None: - self.capital_camel = capital_camel - if small_snake is not None: - self.small_snake = small_snake - if capital_snake is not None: - self.capital_snake = capital_snake - if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points - if att_name is not None: - self.att_name = att_name - - @property - def small_camel(self): - """Gets the small_camel of this Capitalization. # noqa: E501 - - - :return: The small_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_camel - - @small_camel.setter - def small_camel(self, small_camel): - """Sets the small_camel of this Capitalization. - - - :param small_camel: The small_camel of this Capitalization. # noqa: E501 - :type small_camel: str - """ - - self._small_camel = small_camel - - @property - def capital_camel(self): - """Gets the capital_camel of this Capitalization. # noqa: E501 - - - :return: The capital_camel of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_camel - - @capital_camel.setter - def capital_camel(self, capital_camel): - """Sets the capital_camel of this Capitalization. - - - :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 - :type capital_camel: str - """ - - self._capital_camel = capital_camel - - @property - def small_snake(self): - """Gets the small_snake of this Capitalization. # noqa: E501 - - - :return: The small_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._small_snake - - @small_snake.setter - def small_snake(self, small_snake): - """Sets the small_snake of this Capitalization. - - - :param small_snake: The small_snake of this Capitalization. # noqa: E501 - :type small_snake: str - """ - - self._small_snake = small_snake - - @property - def capital_snake(self): - """Gets the capital_snake of this Capitalization. # noqa: E501 - - - :return: The capital_snake of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._capital_snake - - @capital_snake.setter - def capital_snake(self, capital_snake): - """Sets the capital_snake of this Capitalization. - - - :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 - :type capital_snake: str - """ - - self._capital_snake = capital_snake - - @property - def sca_eth_flow_points(self): - """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - - - :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._sca_eth_flow_points - - @sca_eth_flow_points.setter - def sca_eth_flow_points(self, sca_eth_flow_points): - """Sets the sca_eth_flow_points of this Capitalization. - - - :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 - :type sca_eth_flow_points: str - """ - - self._sca_eth_flow_points = sca_eth_flow_points - - @property - def att_name(self): - """Gets the att_name of this Capitalization. # noqa: E501 - - Name of the pet # noqa: E501 - - :return: The att_name of this Capitalization. # noqa: E501 - :rtype: str - """ - return self._att_name - - @att_name.setter - def att_name(self, att_name): - """Sets the att_name of this Capitalization. - - Name of the pet # noqa: E501 - - :param att_name: The att_name of this Capitalization. # noqa: E501 - :type att_name: str - """ - - self._att_name = att_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Capitalization): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Capitalization): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py deleted file mode 100755 index 0d9a0b20bf1a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Cat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """Cat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this Cat. # noqa: E501 - - - :return: The declawed of this Cat. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this Cat. - - - :param declawed: The declawed of this Cat. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Cat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Cat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py deleted file mode 100755 index 0633bbf58d0d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/cat_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class CatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'declawed': 'bool' - } - - attribute_map = { - 'declawed': 'declawed' - } - - def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._declawed = None - self.discriminator = None - - if declawed is not None: - self.declawed = declawed - - @property - def declawed(self): - """Gets the declawed of this CatAllOf. # noqa: E501 - - - :return: The declawed of this CatAllOf. # noqa: E501 - :rtype: bool - """ - return self._declawed - - @declawed.setter - def declawed(self, declawed): - """Sets the declawed of this CatAllOf. - - - :param declawed: The declawed of this CatAllOf. # noqa: E501 - :type declawed: bool - """ - - self._declawed = declawed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py deleted file mode 100755 index ef52dcbf8c91..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/category.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Category(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 - """Category - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - - @property - def id(self): - """Gets the id of this Category. # noqa: E501 - - - :return: The id of this Category. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Category. - - - :param id: The id of this Category. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Category. # noqa: E501 - - - :return: The name of this Category. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Category. - - - :param name: The name of this Category. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Category): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Category): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py deleted file mode 100755 index 84c0de65b472..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/class_model.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ClassModel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_class': 'str' - } - - attribute_map = { - '_class': '_class' - } - - def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__class = None - self.discriminator = None - - if _class is not None: - self._class = _class - - @property - def _class(self): - """Gets the _class of this ClassModel. # noqa: E501 - - - :return: The _class of this ClassModel. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this ClassModel. - - - :param _class: The _class of this ClassModel. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ClassModel): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ClassModel): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py deleted file mode 100755 index 8d7c83ecfe6b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/client.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Client(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'client': 'str' - } - - attribute_map = { - 'client': 'client' - } - - def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 - """Client - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._client = None - self.discriminator = None - - if client is not None: - self.client = client - - @property - def client(self): - """Gets the client of this Client. # noqa: E501 - - - :return: The client of this Client. # noqa: E501 - :rtype: str - """ - return self._client - - @client.setter - def client(self, client): - """Sets the client of this Client. - - - :param client: The client of this Client. # noqa: E501 - :type client: str - """ - - self._client = client - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Client): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Client): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/deprecated_object.py deleted file mode 100644 index 04d3f1e64b9e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/deprecated_object.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class DeprecatedObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """DeprecatedObject - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this DeprecatedObject. # noqa: E501 - - - :return: The name of this DeprecatedObject. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this DeprecatedObject. - - - :param name: The name of this DeprecatedObject. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DeprecatedObject): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DeprecatedObject): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py deleted file mode 100755 index 61acd35cdfe2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Dog(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """Dog - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this Dog. # noqa: E501 - - - :return: The breed of this Dog. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this Dog. - - - :param breed: The breed of this Dog. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dog): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Dog): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py deleted file mode 100755 index 3a052c3258ae..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/dog_all_of.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class DogAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'breed': 'str' - } - - attribute_map = { - 'breed': 'breed' - } - - def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._breed = None - self.discriminator = None - - if breed is not None: - self.breed = breed - - @property - def breed(self): - """Gets the breed of this DogAllOf. # noqa: E501 - - - :return: The breed of this DogAllOf. # noqa: E501 - :rtype: str - """ - return self._breed - - @breed.setter - def breed(self, breed): - """Sets the breed of this DogAllOf. - - - :param breed: The breed of this DogAllOf. # noqa: E501 - :type breed: str - """ - - self._breed = breed - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DogAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DogAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py deleted file mode 100755 index eb4f3ea4ca32..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_arrays.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumArrays(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]' - } - - attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' - } - - def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_symbol = None - self._array_enum = None - self.discriminator = None - - if just_symbol is not None: - self.just_symbol = just_symbol - if array_enum is not None: - self.array_enum = array_enum - - @property - def just_symbol(self): - """Gets the just_symbol of this EnumArrays. # noqa: E501 - - - :return: The just_symbol of this EnumArrays. # noqa: E501 - :rtype: str - """ - return self._just_symbol - - @just_symbol.setter - def just_symbol(self, just_symbol): - """Sets the just_symbol of this EnumArrays. - - - :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 - :type just_symbol: str - """ - allowed_values = [">=", "$"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 - .format(just_symbol, allowed_values) - ) - - self._just_symbol = just_symbol - - @property - def array_enum(self): - """Gets the array_enum of this EnumArrays. # noqa: E501 - - - :return: The array_enum of this EnumArrays. # noqa: E501 - :rtype: list[str] - """ - return self._array_enum - - @array_enum.setter - def array_enum(self, array_enum): - """Sets the array_enum of this EnumArrays. - - - :param array_enum: The array_enum of this EnumArrays. # noqa: E501 - :type array_enum: list[str] - """ - allowed_values = ["fish", "crab"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(array_enum).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._array_enum = array_enum - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumArrays): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumArrays): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py deleted file mode 100755 index 79aac3570cb9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_class.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _ABC = "_abc" - _EFG = "-efg" - _XYZ_ = "(xyz)" - - allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """EnumClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py deleted file mode 100755 index 93333df88781..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/enum_test.py +++ /dev/null @@ -1,337 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class EnumTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'enum_string': 'str', - 'enum_string_required': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum', - 'outer_enum_integer': 'OuterEnumInteger', - 'outer_enum_default_value': 'OuterEnumDefaultValue', - 'outer_enum_integer_default_value': 'OuterEnumIntegerDefaultValue' - } - - attribute_map = { - 'enum_string': 'enum_string', - 'enum_string_required': 'enum_string_required', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum', - 'outer_enum_integer': 'outerEnumInteger', - 'outer_enum_default_value': 'outerEnumDefaultValue', - 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue' - } - - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, outer_enum_integer=None, outer_enum_default_value=None, outer_enum_integer_default_value=None, local_vars_configuration=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._enum_string = None - self._enum_string_required = None - self._enum_integer = None - self._enum_number = None - self._outer_enum = None - self._outer_enum_integer = None - self._outer_enum_default_value = None - self._outer_enum_integer_default_value = None - self.discriminator = None - - if enum_string is not None: - self.enum_string = enum_string - self.enum_string_required = enum_string_required - if enum_integer is not None: - self.enum_integer = enum_integer - if enum_number is not None: - self.enum_number = enum_number - self.outer_enum = outer_enum - if outer_enum_integer is not None: - self.outer_enum_integer = outer_enum_integer - if outer_enum_default_value is not None: - self.outer_enum_default_value = outer_enum_default_value - if outer_enum_integer_default_value is not None: - self.outer_enum_integer_default_value = outer_enum_integer_default_value - - @property - def enum_string(self): - """Gets the enum_string of this EnumTest. # noqa: E501 - - - :return: The enum_string of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string - - @enum_string.setter - def enum_string(self, enum_string): - """Sets the enum_string of this EnumTest. - - - :param enum_string: The enum_string of this EnumTest. # noqa: E501 - :type enum_string: str - """ - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string, allowed_values) - ) - - self._enum_string = enum_string - - @property - def enum_string_required(self): - """Gets the enum_string_required of this EnumTest. # noqa: E501 - - - :return: The enum_string_required of this EnumTest. # noqa: E501 - :rtype: str - """ - return self._enum_string_required - - @enum_string_required.setter - def enum_string_required(self, enum_string_required): - """Sets the enum_string_required of this EnumTest. - - - :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 - :type enum_string_required: str - """ - if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 - raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string_required, allowed_values) - ) - - self._enum_string_required = enum_string_required - - @property - def enum_integer(self): - """Gets the enum_integer of this EnumTest. # noqa: E501 - - - :return: The enum_integer of this EnumTest. # noqa: E501 - :rtype: int - """ - return self._enum_integer - - @enum_integer.setter - def enum_integer(self, enum_integer): - """Sets the enum_integer of this EnumTest. - - - :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 - :type enum_integer: int - """ - allowed_values = [1, -1] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 - .format(enum_integer, allowed_values) - ) - - self._enum_integer = enum_integer - - @property - def enum_number(self): - """Gets the enum_number of this EnumTest. # noqa: E501 - - - :return: The enum_number of this EnumTest. # noqa: E501 - :rtype: float - """ - return self._enum_number - - @enum_number.setter - def enum_number(self, enum_number): - """Sets the enum_number of this EnumTest. - - - :param enum_number: The enum_number of this EnumTest. # noqa: E501 - :type enum_number: float - """ - allowed_values = [1.1, -1.2] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 - .format(enum_number, allowed_values) - ) - - self._enum_number = enum_number - - @property - def outer_enum(self): - """Gets the outer_enum of this EnumTest. # noqa: E501 - - - :return: The outer_enum of this EnumTest. # noqa: E501 - :rtype: OuterEnum - """ - return self._outer_enum - - @outer_enum.setter - def outer_enum(self, outer_enum): - """Sets the outer_enum of this EnumTest. - - - :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 - :type outer_enum: OuterEnum - """ - - self._outer_enum = outer_enum - - @property - def outer_enum_integer(self): - """Gets the outer_enum_integer of this EnumTest. # noqa: E501 - - - :return: The outer_enum_integer of this EnumTest. # noqa: E501 - :rtype: OuterEnumInteger - """ - return self._outer_enum_integer - - @outer_enum_integer.setter - def outer_enum_integer(self, outer_enum_integer): - """Sets the outer_enum_integer of this EnumTest. - - - :param outer_enum_integer: The outer_enum_integer of this EnumTest. # noqa: E501 - :type outer_enum_integer: OuterEnumInteger - """ - - self._outer_enum_integer = outer_enum_integer - - @property - def outer_enum_default_value(self): - """Gets the outer_enum_default_value of this EnumTest. # noqa: E501 - - - :return: The outer_enum_default_value of this EnumTest. # noqa: E501 - :rtype: OuterEnumDefaultValue - """ - return self._outer_enum_default_value - - @outer_enum_default_value.setter - def outer_enum_default_value(self, outer_enum_default_value): - """Sets the outer_enum_default_value of this EnumTest. - - - :param outer_enum_default_value: The outer_enum_default_value of this EnumTest. # noqa: E501 - :type outer_enum_default_value: OuterEnumDefaultValue - """ - - self._outer_enum_default_value = outer_enum_default_value - - @property - def outer_enum_integer_default_value(self): - """Gets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 - - - :return: The outer_enum_integer_default_value of this EnumTest. # noqa: E501 - :rtype: OuterEnumIntegerDefaultValue - """ - return self._outer_enum_integer_default_value - - @outer_enum_integer_default_value.setter - def outer_enum_integer_default_value(self, outer_enum_integer_default_value): - """Sets the outer_enum_integer_default_value of this EnumTest. - - - :param outer_enum_integer_default_value: The outer_enum_integer_default_value of this EnumTest. # noqa: E501 - :type outer_enum_integer_default_value: OuterEnumIntegerDefaultValue - """ - - self._outer_enum_integer_default_value = outer_enum_integer_default_value - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EnumTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py deleted file mode 100755 index 2c1cccac0e11..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class File(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'source_uri': 'str' - } - - attribute_map = { - 'source_uri': 'sourceURI' - } - - def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 - """File - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._source_uri = None - self.discriminator = None - - if source_uri is not None: - self.source_uri = source_uri - - @property - def source_uri(self): - """Gets the source_uri of this File. # noqa: E501 - - Test capitalization # noqa: E501 - - :return: The source_uri of this File. # noqa: E501 - :rtype: str - """ - return self._source_uri - - @source_uri.setter - def source_uri(self, source_uri): - """Sets the source_uri of this File. - - Test capitalization # noqa: E501 - - :param source_uri: The source_uri of this File. # noqa: E501 - :type source_uri: str - """ - - self._source_uri = source_uri - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, File): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, File): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py deleted file mode 100755 index c5a23842d4f6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/file_schema_test_class.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FileSchemaTestClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'file': 'File', - 'files': 'list[File]' - } - - attribute_map = { - 'file': 'file', - 'files': 'files' - } - - def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._file = None - self._files = None - self.discriminator = None - - if file is not None: - self.file = file - if files is not None: - self.files = files - - @property - def file(self): - """Gets the file of this FileSchemaTestClass. # noqa: E501 - - - :return: The file of this FileSchemaTestClass. # noqa: E501 - :rtype: File - """ - return self._file - - @file.setter - def file(self, file): - """Sets the file of this FileSchemaTestClass. - - - :param file: The file of this FileSchemaTestClass. # noqa: E501 - :type file: File - """ - - self._file = file - - @property - def files(self): - """Gets the files of this FileSchemaTestClass. # noqa: E501 - - - :return: The files of this FileSchemaTestClass. # noqa: E501 - :rtype: list[File] - """ - return self._files - - @files.setter - def files(self, files): - """Sets the files of this FileSchemaTestClass. - - - :param files: The files of this FileSchemaTestClass. # noqa: E501 - :type files: list[File] - """ - - self._files = files - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FileSchemaTestClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FileSchemaTestClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py deleted file mode 100755 index cab632f369c4..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Foo(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str' - } - - attribute_map = { - 'bar': 'bar' - } - - def __init__(self, bar='bar', local_vars_configuration=None): # noqa: E501 - """Foo - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self.discriminator = None - - if bar is not None: - self.bar = bar - - @property - def bar(self): - """Gets the bar of this Foo. # noqa: E501 - - - :return: The bar of this Foo. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this Foo. - - - :param bar: The bar of this Foo. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Foo): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Foo): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo_get_default_response.py deleted file mode 100644 index 54c9cab12a11..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/foo_get_default_response.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FooGetDefaultResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string': 'Foo' - } - - attribute_map = { - 'string': 'string' - } - - def __init__(self, string=None, local_vars_configuration=None): # noqa: E501 - """FooGetDefaultResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string = None - self.discriminator = None - - if string is not None: - self.string = string - - @property - def string(self): - """Gets the string of this FooGetDefaultResponse. # noqa: E501 - - - :return: The string of this FooGetDefaultResponse. # noqa: E501 - :rtype: Foo - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this FooGetDefaultResponse. - - - :param string: The string of this FooGetDefaultResponse. # noqa: E501 - :type string: Foo - """ - - self._string = string - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FooGetDefaultResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FooGetDefaultResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py deleted file mode 100755 index 4e96a7b9175e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/format_test.py +++ /dev/null @@ -1,574 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class FormatTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'decimal': 'Decimal', - 'string': 'str', - 'byte': 'str', - 'binary': 'file', - 'date': 'date', - 'date_time': 'datetime', - 'uuid': 'str', - 'password': 'str', - 'pattern_with_digits': 'str', - 'pattern_with_digits_and_delimiter': 'str' - } - - attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'decimal': 'decimal', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password', - 'pattern_with_digits': 'pattern_with_digits', - 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter' - } - - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, decimal=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, pattern_with_digits=None, pattern_with_digits_and_delimiter=None, local_vars_configuration=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer = None - self._int32 = None - self._int64 = None - self._number = None - self._float = None - self._double = None - self._decimal = None - self._string = None - self._byte = None - self._binary = None - self._date = None - self._date_time = None - self._uuid = None - self._password = None - self._pattern_with_digits = None - self._pattern_with_digits_and_delimiter = None - self.discriminator = None - - if integer is not None: - self.integer = integer - if int32 is not None: - self.int32 = int32 - if int64 is not None: - self.int64 = int64 - self.number = number - if float is not None: - self.float = float - if double is not None: - self.double = double - if decimal is not None: - self.decimal = decimal - if string is not None: - self.string = string - self.byte = byte - if binary is not None: - self.binary = binary - self.date = date - if date_time is not None: - self.date_time = date_time - if uuid is not None: - self.uuid = uuid - self.password = password - if pattern_with_digits is not None: - self.pattern_with_digits = pattern_with_digits - if pattern_with_digits_and_delimiter is not None: - self.pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter - - @property - def integer(self): - """Gets the integer of this FormatTest. # noqa: E501 - - - :return: The integer of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this FormatTest. - - - :param integer: The integer of this FormatTest. # noqa: E501 - :type integer: int - """ - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer > 100): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer < 10): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - - self._integer = integer - - @property - def int32(self): - """Gets the int32 of this FormatTest. # noqa: E501 - - - :return: The int32 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int32 - - @int32.setter - def int32(self, int32): - """Sets the int32 of this FormatTest. - - - :param int32: The int32 of this FormatTest. # noqa: E501 - :type int32: int - """ - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 > 200): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 < 20): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - - self._int32 = int32 - - @property - def int64(self): - """Gets the int64 of this FormatTest. # noqa: E501 - - - :return: The int64 of this FormatTest. # noqa: E501 - :rtype: int - """ - return self._int64 - - @int64.setter - def int64(self, int64): - """Sets the int64 of this FormatTest. - - - :param int64: The int64 of this FormatTest. # noqa: E501 - :type int64: int - """ - - self._int64 = int64 - - @property - def number(self): - """Gets the number of this FormatTest. # noqa: E501 - - - :return: The number of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this FormatTest. - - - :param number: The number of this FormatTest. # noqa: E501 - :type number: float - """ - if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number > 543.2): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number < 32.1): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - - self._number = number - - @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 - - - :return: The float of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._float - - @float.setter - def float(self, float): - """Sets the float of this FormatTest. - - - :param float: The float of this FormatTest. # noqa: E501 - :type float: float - """ - if (self.local_vars_configuration.client_side_validation and - float is not None and float > 987.6): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - float is not None and float < 54.3): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 - - self._float = float - - @property - def double(self): - """Gets the double of this FormatTest. # noqa: E501 - - - :return: The double of this FormatTest. # noqa: E501 - :rtype: float - """ - return self._double - - @double.setter - def double(self, double): - """Sets the double of this FormatTest. - - - :param double: The double of this FormatTest. # noqa: E501 - :type double: float - """ - if (self.local_vars_configuration.client_side_validation and - double is not None and double > 123.4): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double < 67.8): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - - self._double = double - - @property - def decimal(self): - """Gets the decimal of this FormatTest. # noqa: E501 - - - :return: The decimal of this FormatTest. # noqa: E501 - :rtype: Decimal - """ - return self._decimal - - @decimal.setter - def decimal(self, decimal): - """Sets the decimal of this FormatTest. - - - :param decimal: The decimal of this FormatTest. # noqa: E501 - :type decimal: Decimal - """ - - self._decimal = decimal - - @property - def string(self): - """Gets the string of this FormatTest. # noqa: E501 - - - :return: The string of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this FormatTest. - - - :param string: The string of this FormatTest. # noqa: E501 - :type string: str - """ - if (self.local_vars_configuration.client_side_validation and - string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - - self._string = string - - @property - def byte(self): - """Gets the byte of this FormatTest. # noqa: E501 - - - :return: The byte of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._byte - - @byte.setter - def byte(self, byte): - """Sets the byte of this FormatTest. - - - :param byte: The byte of this FormatTest. # noqa: E501 - :type byte: str - """ - if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - - self._byte = byte - - @property - def binary(self): - """Gets the binary of this FormatTest. # noqa: E501 - - - :return: The binary of this FormatTest. # noqa: E501 - :rtype: file - """ - return self._binary - - @binary.setter - def binary(self, binary): - """Sets the binary of this FormatTest. - - - :param binary: The binary of this FormatTest. # noqa: E501 - :type binary: file - """ - - self._binary = binary - - @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 - - - :return: The date of this FormatTest. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this FormatTest. - - - :param date: The date of this FormatTest. # noqa: E501 - :type date: date - """ - if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - - self._date = date - - @property - def date_time(self): - """Gets the date_time of this FormatTest. # noqa: E501 - - - :return: The date_time of this FormatTest. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this FormatTest. - - - :param date_time: The date_time of this FormatTest. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def uuid(self): - """Gets the uuid of this FormatTest. # noqa: E501 - - - :return: The uuid of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this FormatTest. - - - :param uuid: The uuid of this FormatTest. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def password(self): - """Gets the password of this FormatTest. # noqa: E501 - - - :return: The password of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this FormatTest. - - - :param password: The password of this FormatTest. # noqa: E501 - :type password: str - """ - if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) > 64): - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) < 10): - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - - self._password = password - - @property - def pattern_with_digits(self): - """Gets the pattern_with_digits of this FormatTest. # noqa: E501 - - A string that is a 10 digit number. Can have leading zeros. # noqa: E501 - - :return: The pattern_with_digits of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._pattern_with_digits - - @pattern_with_digits.setter - def pattern_with_digits(self, pattern_with_digits): - """Sets the pattern_with_digits of this FormatTest. - - A string that is a 10 digit number. Can have leading zeros. # noqa: E501 - - :param pattern_with_digits: The pattern_with_digits of this FormatTest. # noqa: E501 - :type pattern_with_digits: str - """ - if (self.local_vars_configuration.client_side_validation and - pattern_with_digits is not None and not re.search(r'^\d{10}$', pattern_with_digits)): # noqa: E501 - raise ValueError(r"Invalid value for `pattern_with_digits`, must be a follow pattern or equal to `/^\d{10}$/`") # noqa: E501 - - self._pattern_with_digits = pattern_with_digits - - @property - def pattern_with_digits_and_delimiter(self): - """Gets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 - - :return: The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - :rtype: str - """ - return self._pattern_with_digits_and_delimiter - - @pattern_with_digits_and_delimiter.setter - def pattern_with_digits_and_delimiter(self, pattern_with_digits_and_delimiter): - """Sets the pattern_with_digits_and_delimiter of this FormatTest. - - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 - - :param pattern_with_digits_and_delimiter: The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - :type pattern_with_digits_and_delimiter: str - """ - if (self.local_vars_configuration.client_side_validation and - pattern_with_digits_and_delimiter is not None and not re.search(r'^image_\d{1,3}$', pattern_with_digits_and_delimiter, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `pattern_with_digits_and_delimiter`, must be a follow pattern or equal to `/^image_\d{1,3}$/i`") # noqa: E501 - - self._pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FormatTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FormatTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py deleted file mode 100755 index 7175c2acc721..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/has_only_read_only.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class HasOnlyReadOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'foo': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'foo': 'foo' - } - - def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._foo = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if foo is not None: - self.foo = foo - - @property - def bar(self): - """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - - - :return: The bar of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this HasOnlyReadOnly. - - - :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def foo(self): - """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - - - :return: The foo of this HasOnlyReadOnly. # noqa: E501 - :rtype: str - """ - return self._foo - - @foo.setter - def foo(self, foo): - """Sets the foo of this HasOnlyReadOnly. - - - :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 - :type foo: str - """ - - self._foo = foo - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HasOnlyReadOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, HasOnlyReadOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py deleted file mode 100755 index 64a3f4b2b903..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/health_check_result.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class HealthCheckResult(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'nullable_message': 'str' - } - - attribute_map = { - 'nullable_message': 'NullableMessage' - } - - def __init__(self, nullable_message=None, local_vars_configuration=None): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._nullable_message = None - self.discriminator = None - - self.nullable_message = nullable_message - - @property - def nullable_message(self): - """Gets the nullable_message of this HealthCheckResult. # noqa: E501 - - - :return: The nullable_message of this HealthCheckResult. # noqa: E501 - :rtype: str - """ - return self._nullable_message - - @nullable_message.setter - def nullable_message(self, nullable_message): - """Sets the nullable_message of this HealthCheckResult. - - - :param nullable_message: The nullable_message of this HealthCheckResult. # noqa: E501 - :type nullable_message: str - """ - - self._nullable_message = nullable_message - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HealthCheckResult): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, HealthCheckResult): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py deleted file mode 100755 index 0fe31d990ea9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'status': 'str' - } - - attribute_map = { - 'name': 'name', - 'status': 'status' - } - - def __init__(self, name=None, status=None, local_vars_configuration=None): # noqa: E501 - """InlineObject - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._status = None - self.discriminator = None - - if name is not None: - self.name = name - if status is not None: - self.status = status - - @property - def name(self): - """Gets the name of this InlineObject. # noqa: E501 - - Updated name of the pet # noqa: E501 - - :return: The name of this InlineObject. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this InlineObject. - - Updated name of the pet # noqa: E501 - - :param name: The name of this InlineObject. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def status(self): - """Gets the status of this InlineObject. # noqa: E501 - - Updated status of the pet # noqa: E501 - - :return: The status of this InlineObject. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this InlineObject. - - Updated status of the pet # noqa: E501 - - :param status: The status of this InlineObject. # noqa: E501 - :type status: str - """ - - self._status = status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py deleted file mode 100755 index 5ca7d1743b84..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object1.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject1(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'additional_metadata': 'str', - 'file': 'file' - } - - attribute_map = { - 'additional_metadata': 'additionalMetadata', - 'file': 'file' - } - - def __init__(self, additional_metadata=None, file=None, local_vars_configuration=None): # noqa: E501 - """InlineObject1 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._additional_metadata = None - self._file = None - self.discriminator = None - - if additional_metadata is not None: - self.additional_metadata = additional_metadata - if file is not None: - self.file = file - - @property - def additional_metadata(self): - """Gets the additional_metadata of this InlineObject1. # noqa: E501 - - Additional data to pass to server # noqa: E501 - - :return: The additional_metadata of this InlineObject1. # noqa: E501 - :rtype: str - """ - return self._additional_metadata - - @additional_metadata.setter - def additional_metadata(self, additional_metadata): - """Sets the additional_metadata of this InlineObject1. - - Additional data to pass to server # noqa: E501 - - :param additional_metadata: The additional_metadata of this InlineObject1. # noqa: E501 - :type additional_metadata: str - """ - - self._additional_metadata = additional_metadata - - @property - def file(self): - """Gets the file of this InlineObject1. # noqa: E501 - - file to upload # noqa: E501 - - :return: The file of this InlineObject1. # noqa: E501 - :rtype: file - """ - return self._file - - @file.setter - def file(self, file): - """Sets the file of this InlineObject1. - - file to upload # noqa: E501 - - :param file: The file of this InlineObject1. # noqa: E501 - :type file: file - """ - - self._file = file - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject1): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject1): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py deleted file mode 100755 index 5c51b40c9766..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object2.py +++ /dev/null @@ -1,172 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject2(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'enum_form_string_array': 'list[str]', - 'enum_form_string': 'str' - } - - attribute_map = { - 'enum_form_string_array': 'enum_form_string_array', - 'enum_form_string': 'enum_form_string' - } - - def __init__(self, enum_form_string_array=None, enum_form_string='-efg', local_vars_configuration=None): # noqa: E501 - """InlineObject2 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._enum_form_string_array = None - self._enum_form_string = None - self.discriminator = None - - if enum_form_string_array is not None: - self.enum_form_string_array = enum_form_string_array - if enum_form_string is not None: - self.enum_form_string = enum_form_string - - @property - def enum_form_string_array(self): - """Gets the enum_form_string_array of this InlineObject2. # noqa: E501 - - Form parameter enum test (string array) # noqa: E501 - - :return: The enum_form_string_array of this InlineObject2. # noqa: E501 - :rtype: list[str] - """ - return self._enum_form_string_array - - @enum_form_string_array.setter - def enum_form_string_array(self, enum_form_string_array): - """Sets the enum_form_string_array of this InlineObject2. - - Form parameter enum test (string array) # noqa: E501 - - :param enum_form_string_array: The enum_form_string_array of this InlineObject2. # noqa: E501 - :type enum_form_string_array: list[str] - """ - allowed_values = [">", "$"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(enum_form_string_array).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(enum_form_string_array) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._enum_form_string_array = enum_form_string_array - - @property - def enum_form_string(self): - """Gets the enum_form_string of this InlineObject2. # noqa: E501 - - Form parameter enum test (string) # noqa: E501 - - :return: The enum_form_string of this InlineObject2. # noqa: E501 - :rtype: str - """ - return self._enum_form_string - - @enum_form_string.setter - def enum_form_string(self, enum_form_string): - """Sets the enum_form_string of this InlineObject2. - - Form parameter enum test (string) # noqa: E501 - - :param enum_form_string: The enum_form_string of this InlineObject2. # noqa: E501 - :type enum_form_string: str - """ - allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and enum_form_string not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `enum_form_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_form_string, allowed_values) - ) - - self._enum_form_string = enum_form_string - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject2): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject2): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py deleted file mode 100755 index f604a543616b..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object3.py +++ /dev/null @@ -1,537 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject3(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'pattern_without_delimiter': 'str', - 'byte': 'str', - 'binary': 'file', - 'date': 'date', - 'date_time': 'datetime', - 'password': 'str', - 'callback': 'str' - } - - attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'pattern_without_delimiter': 'pattern_without_delimiter', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'password': 'password', - 'callback': 'callback' - } - - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, date=None, date_time=None, password=None, callback=None, local_vars_configuration=None): # noqa: E501 - """InlineObject3 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer = None - self._int32 = None - self._int64 = None - self._number = None - self._float = None - self._double = None - self._string = None - self._pattern_without_delimiter = None - self._byte = None - self._binary = None - self._date = None - self._date_time = None - self._password = None - self._callback = None - self.discriminator = None - - if integer is not None: - self.integer = integer - if int32 is not None: - self.int32 = int32 - if int64 is not None: - self.int64 = int64 - self.number = number - if float is not None: - self.float = float - self.double = double - if string is not None: - self.string = string - self.pattern_without_delimiter = pattern_without_delimiter - self.byte = byte - if binary is not None: - self.binary = binary - if date is not None: - self.date = date - if date_time is not None: - self.date_time = date_time - if password is not None: - self.password = password - if callback is not None: - self.callback = callback - - @property - def integer(self): - """Gets the integer of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The integer of this InlineObject3. # noqa: E501 - :rtype: int - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this InlineObject3. - - None # noqa: E501 - - :param integer: The integer of this InlineObject3. # noqa: E501 - :type integer: int - """ - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer > 100): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - integer is not None and integer < 10): # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - - self._integer = integer - - @property - def int32(self): - """Gets the int32 of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The int32 of this InlineObject3. # noqa: E501 - :rtype: int - """ - return self._int32 - - @int32.setter - def int32(self, int32): - """Sets the int32 of this InlineObject3. - - None # noqa: E501 - - :param int32: The int32 of this InlineObject3. # noqa: E501 - :type int32: int - """ - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 > 200): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - int32 is not None and int32 < 20): # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - - self._int32 = int32 - - @property - def int64(self): - """Gets the int64 of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The int64 of this InlineObject3. # noqa: E501 - :rtype: int - """ - return self._int64 - - @int64.setter - def int64(self, int64): - """Sets the int64 of this InlineObject3. - - None # noqa: E501 - - :param int64: The int64 of this InlineObject3. # noqa: E501 - :type int64: int - """ - - self._int64 = int64 - - @property - def number(self): - """Gets the number of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The number of this InlineObject3. # noqa: E501 - :rtype: float - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this InlineObject3. - - None # noqa: E501 - - :param number: The number of this InlineObject3. # noqa: E501 - :type number: float - """ - if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number > 543.2): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - number is not None and number < 32.1): # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - - self._number = number - - @property - def float(self): - """Gets the float of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The float of this InlineObject3. # noqa: E501 - :rtype: float - """ - return self._float - - @float.setter - def float(self, float): - """Sets the float of this InlineObject3. - - None # noqa: E501 - - :param float: The float of this InlineObject3. # noqa: E501 - :type float: float - """ - if (self.local_vars_configuration.client_side_validation and - float is not None and float > 987.6): # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - - self._float = float - - @property - def double(self): - """Gets the double of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The double of this InlineObject3. # noqa: E501 - :rtype: float - """ - return self._double - - @double.setter - def double(self, double): - """Sets the double of this InlineObject3. - - None # noqa: E501 - - :param double: The double of this InlineObject3. # noqa: E501 - :type double: float - """ - if self.local_vars_configuration.client_side_validation and double is None: # noqa: E501 - raise ValueError("Invalid value for `double`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double > 123.4): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - double is not None and double < 67.8): # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - - self._double = double - - @property - def string(self): - """Gets the string of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The string of this InlineObject3. # noqa: E501 - :rtype: str - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this InlineObject3. - - None # noqa: E501 - - :param string: The string of this InlineObject3. # noqa: E501 - :type string: str - """ - if (self.local_vars_configuration.client_side_validation and - string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - - self._string = string - - @property - def pattern_without_delimiter(self): - """Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The pattern_without_delimiter of this InlineObject3. # noqa: E501 - :rtype: str - """ - return self._pattern_without_delimiter - - @pattern_without_delimiter.setter - def pattern_without_delimiter(self, pattern_without_delimiter): - """Sets the pattern_without_delimiter of this InlineObject3. - - None # noqa: E501 - - :param pattern_without_delimiter: The pattern_without_delimiter of this InlineObject3. # noqa: E501 - :type pattern_without_delimiter: str - """ - if self.local_vars_configuration.client_side_validation and pattern_without_delimiter is None: # noqa: E501 - raise ValueError("Invalid value for `pattern_without_delimiter`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - pattern_without_delimiter is not None and not re.search(r'^[A-Z].*', pattern_without_delimiter)): # noqa: E501 - raise ValueError(r"Invalid value for `pattern_without_delimiter`, must be a follow pattern or equal to `/^[A-Z].*/`") # noqa: E501 - - self._pattern_without_delimiter = pattern_without_delimiter - - @property - def byte(self): - """Gets the byte of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The byte of this InlineObject3. # noqa: E501 - :rtype: str - """ - return self._byte - - @byte.setter - def byte(self, byte): - """Sets the byte of this InlineObject3. - - None # noqa: E501 - - :param byte: The byte of this InlineObject3. # noqa: E501 - :type byte: str - """ - if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - - self._byte = byte - - @property - def binary(self): - """Gets the binary of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The binary of this InlineObject3. # noqa: E501 - :rtype: file - """ - return self._binary - - @binary.setter - def binary(self, binary): - """Sets the binary of this InlineObject3. - - None # noqa: E501 - - :param binary: The binary of this InlineObject3. # noqa: E501 - :type binary: file - """ - - self._binary = binary - - @property - def date(self): - """Gets the date of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The date of this InlineObject3. # noqa: E501 - :rtype: date - """ - return self._date - - @date.setter - def date(self, date): - """Sets the date of this InlineObject3. - - None # noqa: E501 - - :param date: The date of this InlineObject3. # noqa: E501 - :type date: date - """ - - self._date = date - - @property - def date_time(self): - """Gets the date_time of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The date_time of this InlineObject3. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this InlineObject3. - - None # noqa: E501 - - :param date_time: The date_time of this InlineObject3. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def password(self): - """Gets the password of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The password of this InlineObject3. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this InlineObject3. - - None # noqa: E501 - - :param password: The password of this InlineObject3. # noqa: E501 - :type password: str - """ - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) > 64): - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - password is not None and len(password) < 10): - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - - self._password = password - - @property - def callback(self): - """Gets the callback of this InlineObject3. # noqa: E501 - - None # noqa: E501 - - :return: The callback of this InlineObject3. # noqa: E501 - :rtype: str - """ - return self._callback - - @callback.setter - def callback(self, callback): - """Sets the callback of this InlineObject3. - - None # noqa: E501 - - :param callback: The callback of this InlineObject3. # noqa: E501 - :type callback: str - """ - - self._callback = callback - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject3): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject3): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py deleted file mode 100755 index 4cd6b4cefdb2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object4.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject4(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'param': 'str', - 'param2': 'str' - } - - attribute_map = { - 'param': 'param', - 'param2': 'param2' - } - - def __init__(self, param=None, param2=None, local_vars_configuration=None): # noqa: E501 - """InlineObject4 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._param = None - self._param2 = None - self.discriminator = None - - self.param = param - self.param2 = param2 - - @property - def param(self): - """Gets the param of this InlineObject4. # noqa: E501 - - field1 # noqa: E501 - - :return: The param of this InlineObject4. # noqa: E501 - :rtype: str - """ - return self._param - - @param.setter - def param(self, param): - """Sets the param of this InlineObject4. - - field1 # noqa: E501 - - :param param: The param of this InlineObject4. # noqa: E501 - :type param: str - """ - if self.local_vars_configuration.client_side_validation and param is None: # noqa: E501 - raise ValueError("Invalid value for `param`, must not be `None`") # noqa: E501 - - self._param = param - - @property - def param2(self): - """Gets the param2 of this InlineObject4. # noqa: E501 - - field2 # noqa: E501 - - :return: The param2 of this InlineObject4. # noqa: E501 - :rtype: str - """ - return self._param2 - - @param2.setter - def param2(self, param2): - """Sets the param2 of this InlineObject4. - - field2 # noqa: E501 - - :param param2: The param2 of this InlineObject4. # noqa: E501 - :type param2: str - """ - if self.local_vars_configuration.client_side_validation and param2 is None: # noqa: E501 - raise ValueError("Invalid value for `param2`, must not be `None`") # noqa: E501 - - self._param2 = param2 - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject4): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject4): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py deleted file mode 100755 index ba966fc3c346..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_object5.py +++ /dev/null @@ -1,159 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import inspect -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineObject5(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'additional_metadata': 'str', - 'required_file': 'file' - } - - attribute_map = { - 'additional_metadata': 'additionalMetadata', - 'required_file': 'requiredFile' - } - - def __init__(self, additional_metadata=None, required_file=None, local_vars_configuration=None): # noqa: E501 - """InlineObject5 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._additional_metadata = None - self._required_file = None - self.discriminator = None - - if additional_metadata is not None: - self.additional_metadata = additional_metadata - self.required_file = required_file - - @property - def additional_metadata(self): - """Gets the additional_metadata of this InlineObject5. # noqa: E501 - - Additional data to pass to server # noqa: E501 - - :return: The additional_metadata of this InlineObject5. # noqa: E501 - :rtype: str - """ - return self._additional_metadata - - @additional_metadata.setter - def additional_metadata(self, additional_metadata): - """Sets the additional_metadata of this InlineObject5. - - Additional data to pass to server # noqa: E501 - - :param additional_metadata: The additional_metadata of this InlineObject5. # noqa: E501 - :type additional_metadata: str - """ - - self._additional_metadata = additional_metadata - - @property - def required_file(self): - """Gets the required_file of this InlineObject5. # noqa: E501 - - file to upload # noqa: E501 - - :return: The required_file of this InlineObject5. # noqa: E501 - :rtype: file - """ - return self._required_file - - @required_file.setter - def required_file(self, required_file): - """Sets the required_file of this InlineObject5. - - file to upload # noqa: E501 - - :param required_file: The required_file of this InlineObject5. # noqa: E501 - :type required_file: file - """ - if self.local_vars_configuration.client_side_validation and required_file is None: # noqa: E501 - raise ValueError("Invalid value for `required_file`, must not be `None`") # noqa: E501 - - self._required_file = required_file - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = inspect.getargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject5): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject5): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py deleted file mode 100755 index a199122621ff..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/inline_response_default.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class InlineResponseDefault(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'string': 'Foo' - } - - attribute_map = { - 'string': 'string' - } - - def __init__(self, string=None, local_vars_configuration=None): # noqa: E501 - """InlineResponseDefault - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._string = None - self.discriminator = None - - if string is not None: - self.string = string - - @property - def string(self): - """Gets the string of this InlineResponseDefault. # noqa: E501 - - - :return: The string of this InlineResponseDefault. # noqa: E501 - :rtype: Foo - """ - return self._string - - @string.setter - def string(self, string): - """Sets the string of this InlineResponseDefault. - - - :param string: The string of this InlineResponseDefault. # noqa: E501 - :type string: Foo - """ - - self._string = string - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponseDefault): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, InlineResponseDefault): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py deleted file mode 100755 index 6e1dea4e33b5..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/list.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class List(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_123_list': 'str' - } - - attribute_map = { - '_123_list': '123-list' - } - - def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 - """List - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__123_list = None - self.discriminator = None - - if _123_list is not None: - self._123_list = _123_list - - @property - def _123_list(self): - """Gets the _123_list of this List. # noqa: E501 - - - :return: The _123_list of this List. # noqa: E501 - :rtype: str - """ - return self.__123_list - - @_123_list.setter - def _123_list(self, _123_list): - """Sets the _123_list of this List. - - - :param _123_list: The _123_list of this List. # noqa: E501 - :type _123_list: str - """ - - self.__123_list = _123_list - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, List): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, List): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py deleted file mode 100755 index 606253a90d9e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MapTest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'map_map_of_string': 'dict[str, dict[str, str]]', - 'map_of_enum_string': 'dict[str, str]', - 'direct_map': 'dict[str, bool]', - 'indirect_map': 'dict[str, bool]' - } - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string', - 'direct_map': 'direct_map', - 'indirect_map': 'indirect_map' - } - - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 - """MapTest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._map_map_of_string = None - self._map_of_enum_string = None - self._direct_map = None - self._indirect_map = None - self.discriminator = None - - if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string - if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string - if direct_map is not None: - self.direct_map = direct_map - if indirect_map is not None: - self.indirect_map = indirect_map - - @property - def map_map_of_string(self): - """Gets the map_map_of_string of this MapTest. # noqa: E501 - - - :return: The map_map_of_string of this MapTest. # noqa: E501 - :rtype: dict[str, dict[str, str]] - """ - return self._map_map_of_string - - @map_map_of_string.setter - def map_map_of_string(self, map_map_of_string): - """Sets the map_map_of_string of this MapTest. - - - :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 - :type map_map_of_string: dict[str, dict[str, str]] - """ - - self._map_map_of_string = map_map_of_string - - @property - def map_of_enum_string(self): - """Gets the map_of_enum_string of this MapTest. # noqa: E501 - - - :return: The map_of_enum_string of this MapTest. # noqa: E501 - :rtype: dict[str, str] - """ - return self._map_of_enum_string - - @map_of_enum_string.setter - def map_of_enum_string(self, map_of_enum_string): - """Sets the map_of_enum_string of this MapTest. - - - :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 - :type map_of_enum_string: dict[str, str] - """ - allowed_values = ["UPPER", "lower"] # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - - self._map_of_enum_string = map_of_enum_string - - @property - def direct_map(self): - """Gets the direct_map of this MapTest. # noqa: E501 - - - :return: The direct_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._direct_map - - @direct_map.setter - def direct_map(self, direct_map): - """Sets the direct_map of this MapTest. - - - :param direct_map: The direct_map of this MapTest. # noqa: E501 - :type direct_map: dict[str, bool] - """ - - self._direct_map = direct_map - - @property - def indirect_map(self): - """Gets the indirect_map of this MapTest. # noqa: E501 - - - :return: The indirect_map of this MapTest. # noqa: E501 - :rtype: dict[str, bool] - """ - return self._indirect_map - - @indirect_map.setter - def indirect_map(self, indirect_map): - """Sets the indirect_map of this MapTest. - - - :param indirect_map: The indirect_map of this MapTest. # noqa: E501 - :type indirect_map: dict[str, bool] - """ - - self._indirect_map = indirect_map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MapTest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MapTest): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py deleted file mode 100755 index 96aedc145c40..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class MixedPropertiesAndAdditionalPropertiesClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict[str, Animal]' - } - - attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' - } - - def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._uuid = None - self._date_time = None - self._map = None - self.discriminator = None - - if uuid is not None: - self.uuid = uuid - if date_time is not None: - self.date_time = date_time - if map is not None: - self.map = map - - @property - def uuid(self): - """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def date_time(self): - """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: datetime - """ - return self._date_time - - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type date_time: datetime - """ - - self._date_time = date_time - - @property - def map(self): - """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :rtype: dict[str, Animal] - """ - return self._map - - @map.setter - def map(self, map): - """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. - - - :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :type map: dict[str, Animal] - """ - - self._map = map - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py deleted file mode 100755 index db587fd24e2f..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - - :return: The name of this Model200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model200Response. - - - :param name: The name of this Model200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - - :return: The _class of this Model200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model200Response. - - - :param _class: The _class of this Model200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_200_response.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_200_response.py deleted file mode 100644 index 96498ac6b1df..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_200_response.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Model_200Response(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 - """Model_200Response - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model_200Response. # noqa: E501 - - - :return: The name of this Model_200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model_200Response. - - - :param name: The name of this Model_200Response. # noqa: E501 - :type name: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model_200Response. # noqa: E501 - - - :return: The _class of this Model_200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model_200Response. - - - :param _class: The _class of this Model_200Response. # noqa: E501 - :type _class: str - """ - - self.__class = _class - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model_200Response): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Model_200Response): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py deleted file mode 100755 index 5354fd56e2ce..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/model_return.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ModelReturn(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_return': 'int' - } - - attribute_map = { - '_return': 'return' - } - - def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self.__return = None - self.discriminator = None - - if _return is not None: - self._return = _return - - @property - def _return(self): - """Gets the _return of this ModelReturn. # noqa: E501 - - - :return: The _return of this ModelReturn. # noqa: E501 - :rtype: int - """ - return self.__return - - @_return.setter - def _return(self, _return): - """Sets the _return of this ModelReturn. - - - :param _return: The _return of this ModelReturn. # noqa: E501 - :type _return: int - """ - - self.__return = _return - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ModelReturn): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ModelReturn): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py deleted file mode 100755 index 0191a3a934ae..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/name.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Name(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int' - } - - attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' - } - - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 - """Name - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._snake_case = None - self.__property = None - self.__123_number = None - self.discriminator = None - - self.name = name - if snake_case is not None: - self.snake_case = snake_case - if _property is not None: - self._property = _property - if _123_number is not None: - self._123_number = _123_number - - @property - def name(self): - """Gets the name of this Name. # noqa: E501 - - - :return: The name of this Name. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Name. - - - :param name: The name of this Name. # noqa: E501 - :type name: int - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def snake_case(self): - """Gets the snake_case of this Name. # noqa: E501 - - - :return: The snake_case of this Name. # noqa: E501 - :rtype: int - """ - return self._snake_case - - @snake_case.setter - def snake_case(self, snake_case): - """Sets the snake_case of this Name. - - - :param snake_case: The snake_case of this Name. # noqa: E501 - :type snake_case: int - """ - - self._snake_case = snake_case - - @property - def _property(self): - """Gets the _property of this Name. # noqa: E501 - - - :return: The _property of this Name. # noqa: E501 - :rtype: str - """ - return self.__property - - @_property.setter - def _property(self, _property): - """Sets the _property of this Name. - - - :param _property: The _property of this Name. # noqa: E501 - :type _property: str - """ - - self.__property = _property - - @property - def _123_number(self): - """Gets the _123_number of this Name. # noqa: E501 - - - :return: The _123_number of this Name. # noqa: E501 - :rtype: int - """ - return self.__123_number - - @_123_number.setter - def _123_number(self, _123_number): - """Sets the _123_number of this Name. - - - :param _123_number: The _123_number of this Name. # noqa: E501 - :type _123_number: int - """ - - self.__123_number = _123_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Name): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Name): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py deleted file mode 100755 index 45f065426615..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py +++ /dev/null @@ -1,407 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class NullableClass(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'integer_prop': 'int', - 'number_prop': 'float', - 'boolean_prop': 'bool', - 'string_prop': 'str', - 'date_prop': 'date', - 'datetime_prop': 'datetime', - 'array_nullable_prop': 'list[object]', - 'array_and_items_nullable_prop': 'list[object]', - 'array_items_nullable': 'list[object]', - 'object_nullable_prop': 'dict[str, object]', - 'object_and_items_nullable_prop': 'dict[str, object]', - 'object_items_nullable': 'dict[str, object]' - } - - attribute_map = { - 'integer_prop': 'integer_prop', - 'number_prop': 'number_prop', - 'boolean_prop': 'boolean_prop', - 'string_prop': 'string_prop', - 'date_prop': 'date_prop', - 'datetime_prop': 'datetime_prop', - 'array_nullable_prop': 'array_nullable_prop', - 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', - 'array_items_nullable': 'array_items_nullable', - 'object_nullable_prop': 'object_nullable_prop', - 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', - 'object_items_nullable': 'object_items_nullable' - } - - def __init__(self, integer_prop=None, number_prop=None, boolean_prop=None, string_prop=None, date_prop=None, datetime_prop=None, array_nullable_prop=None, array_and_items_nullable_prop=None, array_items_nullable=None, object_nullable_prop=None, object_and_items_nullable_prop=None, object_items_nullable=None, local_vars_configuration=None): # noqa: E501 - """NullableClass - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._integer_prop = None - self._number_prop = None - self._boolean_prop = None - self._string_prop = None - self._date_prop = None - self._datetime_prop = None - self._array_nullable_prop = None - self._array_and_items_nullable_prop = None - self._array_items_nullable = None - self._object_nullable_prop = None - self._object_and_items_nullable_prop = None - self._object_items_nullable = None - self.discriminator = None - - self.integer_prop = integer_prop - self.number_prop = number_prop - self.boolean_prop = boolean_prop - self.string_prop = string_prop - self.date_prop = date_prop - self.datetime_prop = datetime_prop - self.array_nullable_prop = array_nullable_prop - self.array_and_items_nullable_prop = array_and_items_nullable_prop - if array_items_nullable is not None: - self.array_items_nullable = array_items_nullable - self.object_nullable_prop = object_nullable_prop - self.object_and_items_nullable_prop = object_and_items_nullable_prop - if object_items_nullable is not None: - self.object_items_nullable = object_items_nullable - - @property - def integer_prop(self): - """Gets the integer_prop of this NullableClass. # noqa: E501 - - - :return: The integer_prop of this NullableClass. # noqa: E501 - :rtype: int - """ - return self._integer_prop - - @integer_prop.setter - def integer_prop(self, integer_prop): - """Sets the integer_prop of this NullableClass. - - - :param integer_prop: The integer_prop of this NullableClass. # noqa: E501 - :type integer_prop: int - """ - - self._integer_prop = integer_prop - - @property - def number_prop(self): - """Gets the number_prop of this NullableClass. # noqa: E501 - - - :return: The number_prop of this NullableClass. # noqa: E501 - :rtype: float - """ - return self._number_prop - - @number_prop.setter - def number_prop(self, number_prop): - """Sets the number_prop of this NullableClass. - - - :param number_prop: The number_prop of this NullableClass. # noqa: E501 - :type number_prop: float - """ - - self._number_prop = number_prop - - @property - def boolean_prop(self): - """Gets the boolean_prop of this NullableClass. # noqa: E501 - - - :return: The boolean_prop of this NullableClass. # noqa: E501 - :rtype: bool - """ - return self._boolean_prop - - @boolean_prop.setter - def boolean_prop(self, boolean_prop): - """Sets the boolean_prop of this NullableClass. - - - :param boolean_prop: The boolean_prop of this NullableClass. # noqa: E501 - :type boolean_prop: bool - """ - - self._boolean_prop = boolean_prop - - @property - def string_prop(self): - """Gets the string_prop of this NullableClass. # noqa: E501 - - - :return: The string_prop of this NullableClass. # noqa: E501 - :rtype: str - """ - return self._string_prop - - @string_prop.setter - def string_prop(self, string_prop): - """Sets the string_prop of this NullableClass. - - - :param string_prop: The string_prop of this NullableClass. # noqa: E501 - :type string_prop: str - """ - - self._string_prop = string_prop - - @property - def date_prop(self): - """Gets the date_prop of this NullableClass. # noqa: E501 - - - :return: The date_prop of this NullableClass. # noqa: E501 - :rtype: date - """ - return self._date_prop - - @date_prop.setter - def date_prop(self, date_prop): - """Sets the date_prop of this NullableClass. - - - :param date_prop: The date_prop of this NullableClass. # noqa: E501 - :type date_prop: date - """ - - self._date_prop = date_prop - - @property - def datetime_prop(self): - """Gets the datetime_prop of this NullableClass. # noqa: E501 - - - :return: The datetime_prop of this NullableClass. # noqa: E501 - :rtype: datetime - """ - return self._datetime_prop - - @datetime_prop.setter - def datetime_prop(self, datetime_prop): - """Sets the datetime_prop of this NullableClass. - - - :param datetime_prop: The datetime_prop of this NullableClass. # noqa: E501 - :type datetime_prop: datetime - """ - - self._datetime_prop = datetime_prop - - @property - def array_nullable_prop(self): - """Gets the array_nullable_prop of this NullableClass. # noqa: E501 - - - :return: The array_nullable_prop of this NullableClass. # noqa: E501 - :rtype: list[object] - """ - return self._array_nullable_prop - - @array_nullable_prop.setter - def array_nullable_prop(self, array_nullable_prop): - """Sets the array_nullable_prop of this NullableClass. - - - :param array_nullable_prop: The array_nullable_prop of this NullableClass. # noqa: E501 - :type array_nullable_prop: list[object] - """ - - self._array_nullable_prop = array_nullable_prop - - @property - def array_and_items_nullable_prop(self): - """Gets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 - - - :return: The array_and_items_nullable_prop of this NullableClass. # noqa: E501 - :rtype: list[object] - """ - return self._array_and_items_nullable_prop - - @array_and_items_nullable_prop.setter - def array_and_items_nullable_prop(self, array_and_items_nullable_prop): - """Sets the array_and_items_nullable_prop of this NullableClass. - - - :param array_and_items_nullable_prop: The array_and_items_nullable_prop of this NullableClass. # noqa: E501 - :type array_and_items_nullable_prop: list[object] - """ - - self._array_and_items_nullable_prop = array_and_items_nullable_prop - - @property - def array_items_nullable(self): - """Gets the array_items_nullable of this NullableClass. # noqa: E501 - - - :return: The array_items_nullable of this NullableClass. # noqa: E501 - :rtype: list[object] - """ - return self._array_items_nullable - - @array_items_nullable.setter - def array_items_nullable(self, array_items_nullable): - """Sets the array_items_nullable of this NullableClass. - - - :param array_items_nullable: The array_items_nullable of this NullableClass. # noqa: E501 - :type array_items_nullable: list[object] - """ - - self._array_items_nullable = array_items_nullable - - @property - def object_nullable_prop(self): - """Gets the object_nullable_prop of this NullableClass. # noqa: E501 - - - :return: The object_nullable_prop of this NullableClass. # noqa: E501 - :rtype: dict[str, object] - """ - return self._object_nullable_prop - - @object_nullable_prop.setter - def object_nullable_prop(self, object_nullable_prop): - """Sets the object_nullable_prop of this NullableClass. - - - :param object_nullable_prop: The object_nullable_prop of this NullableClass. # noqa: E501 - :type object_nullable_prop: dict[str, object] - """ - - self._object_nullable_prop = object_nullable_prop - - @property - def object_and_items_nullable_prop(self): - """Gets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 - - - :return: The object_and_items_nullable_prop of this NullableClass. # noqa: E501 - :rtype: dict[str, object] - """ - return self._object_and_items_nullable_prop - - @object_and_items_nullable_prop.setter - def object_and_items_nullable_prop(self, object_and_items_nullable_prop): - """Sets the object_and_items_nullable_prop of this NullableClass. - - - :param object_and_items_nullable_prop: The object_and_items_nullable_prop of this NullableClass. # noqa: E501 - :type object_and_items_nullable_prop: dict[str, object] - """ - - self._object_and_items_nullable_prop = object_and_items_nullable_prop - - @property - def object_items_nullable(self): - """Gets the object_items_nullable of this NullableClass. # noqa: E501 - - - :return: The object_items_nullable of this NullableClass. # noqa: E501 - :rtype: dict[str, object] - """ - return self._object_items_nullable - - @object_items_nullable.setter - def object_items_nullable(self, object_items_nullable): - """Sets the object_items_nullable of this NullableClass. - - - :param object_items_nullable: The object_items_nullable of this NullableClass. # noqa: E501 - :type object_items_nullable: dict[str, object] - """ - - self._object_items_nullable = object_items_nullable - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NullableClass): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, NullableClass): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py deleted file mode 100755 index 59a252e0bb66..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/number_only.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class NumberOnly(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'just_number': 'float' - } - - attribute_map = { - 'just_number': 'JustNumber' - } - - def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._just_number = None - self.discriminator = None - - if just_number is not None: - self.just_number = just_number - - @property - def just_number(self): - """Gets the just_number of this NumberOnly. # noqa: E501 - - - :return: The just_number of this NumberOnly. # noqa: E501 - :rtype: float - """ - return self._just_number - - @just_number.setter - def just_number(self, just_number): - """Sets the just_number of this NumberOnly. - - - :param just_number: The just_number of this NumberOnly. # noqa: E501 - :type just_number: float - """ - - self._just_number = just_number - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NumberOnly): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, NumberOnly): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/object_with_deprecated_fields.py deleted file mode 100644 index 462ec4980999..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/object_with_deprecated_fields.py +++ /dev/null @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ObjectWithDeprecatedFields(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'uuid': 'str', - 'id': 'float', - 'deprecated_ref': 'DeprecatedObject', - 'bars': 'list[str]' - } - - attribute_map = { - 'uuid': 'uuid', - 'id': 'id', - 'deprecated_ref': 'deprecatedRef', - 'bars': 'bars' - } - - def __init__(self, uuid=None, id=None, deprecated_ref=None, bars=None, local_vars_configuration=None): # noqa: E501 - """ObjectWithDeprecatedFields - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._uuid = None - self._id = None - self._deprecated_ref = None - self._bars = None - self.discriminator = None - - if uuid is not None: - self.uuid = uuid - if id is not None: - self.id = id - if deprecated_ref is not None: - self.deprecated_ref = deprecated_ref - if bars is not None: - self.bars = bars - - @property - def uuid(self): - """Gets the uuid of this ObjectWithDeprecatedFields. # noqa: E501 - - - :return: The uuid of this ObjectWithDeprecatedFields. # noqa: E501 - :rtype: str - """ - return self._uuid - - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this ObjectWithDeprecatedFields. - - - :param uuid: The uuid of this ObjectWithDeprecatedFields. # noqa: E501 - :type uuid: str - """ - - self._uuid = uuid - - @property - def id(self): - """Gets the id of this ObjectWithDeprecatedFields. # noqa: E501 - - - :return: The id of this ObjectWithDeprecatedFields. # noqa: E501 - :rtype: float - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this ObjectWithDeprecatedFields. - - - :param id: The id of this ObjectWithDeprecatedFields. # noqa: E501 - :type id: float - """ - - self._id = id - - @property - def deprecated_ref(self): - """Gets the deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501 - - - :return: The deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501 - :rtype: DeprecatedObject - """ - return self._deprecated_ref - - @deprecated_ref.setter - def deprecated_ref(self, deprecated_ref): - """Sets the deprecated_ref of this ObjectWithDeprecatedFields. - - - :param deprecated_ref: The deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501 - :type deprecated_ref: DeprecatedObject - """ - - self._deprecated_ref = deprecated_ref - - @property - def bars(self): - """Gets the bars of this ObjectWithDeprecatedFields. # noqa: E501 - - - :return: The bars of this ObjectWithDeprecatedFields. # noqa: E501 - :rtype: list[str] - """ - return self._bars - - @bars.setter - def bars(self, bars): - """Sets the bars of this ObjectWithDeprecatedFields. - - - :param bars: The bars of this ObjectWithDeprecatedFields. # noqa: E501 - :type bars: list[str] - """ - - self._bars = bars - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ObjectWithDeprecatedFields): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ObjectWithDeprecatedFields): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py deleted file mode 100755 index a267324d0d19..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/order.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Order(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool' - } - - attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } - - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 - """Order - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._pet_id = None - self._quantity = None - self._ship_date = None - self._status = None - self._complete = None - self.discriminator = None - - if id is not None: - self.id = id - if pet_id is not None: - self.pet_id = pet_id - if quantity is not None: - self.quantity = quantity - if ship_date is not None: - self.ship_date = ship_date - if status is not None: - self.status = status - if complete is not None: - self.complete = complete - - @property - def id(self): - """Gets the id of this Order. # noqa: E501 - - - :return: The id of this Order. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Order. - - - :param id: The id of this Order. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def pet_id(self): - """Gets the pet_id of this Order. # noqa: E501 - - - :return: The pet_id of this Order. # noqa: E501 - :rtype: int - """ - return self._pet_id - - @pet_id.setter - def pet_id(self, pet_id): - """Sets the pet_id of this Order. - - - :param pet_id: The pet_id of this Order. # noqa: E501 - :type pet_id: int - """ - - self._pet_id = pet_id - - @property - def quantity(self): - """Gets the quantity of this Order. # noqa: E501 - - - :return: The quantity of this Order. # noqa: E501 - :rtype: int - """ - return self._quantity - - @quantity.setter - def quantity(self, quantity): - """Sets the quantity of this Order. - - - :param quantity: The quantity of this Order. # noqa: E501 - :type quantity: int - """ - - self._quantity = quantity - - @property - def ship_date(self): - """Gets the ship_date of this Order. # noqa: E501 - - - :return: The ship_date of this Order. # noqa: E501 - :rtype: datetime - """ - return self._ship_date - - @ship_date.setter - def ship_date(self, ship_date): - """Sets the ship_date of this Order. - - - :param ship_date: The ship_date of this Order. # noqa: E501 - :type ship_date: datetime - """ - - self._ship_date = ship_date - - @property - def status(self): - """Gets the status of this Order. # noqa: E501 - - Order Status # noqa: E501 - - :return: The status of this Order. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Order. - - Order Status # noqa: E501 - - :param status: The status of this Order. # noqa: E501 - :type status: str - """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def complete(self): - """Gets the complete of this Order. # noqa: E501 - - - :return: The complete of this Order. # noqa: E501 - :rtype: bool - """ - return self._complete - - @complete.setter - def complete(self, complete): - """Sets the complete of this Order. - - - :param complete: The complete of this Order. # noqa: E501 - :type complete: bool - """ - - self._complete = complete - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Order): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Order): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py deleted file mode 100755 index e26160ab4302..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_composite.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterComposite(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'my_number': 'float', - 'my_string': 'str', - 'my_boolean': 'bool' - } - - attribute_map = { - 'my_number': 'my_number', - 'my_string': 'my_string', - 'my_boolean': 'my_boolean' - } - - def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._my_number = None - self._my_string = None - self._my_boolean = None - self.discriminator = None - - if my_number is not None: - self.my_number = my_number - if my_string is not None: - self.my_string = my_string - if my_boolean is not None: - self.my_boolean = my_boolean - - @property - def my_number(self): - """Gets the my_number of this OuterComposite. # noqa: E501 - - - :return: The my_number of this OuterComposite. # noqa: E501 - :rtype: float - """ - return self._my_number - - @my_number.setter - def my_number(self, my_number): - """Sets the my_number of this OuterComposite. - - - :param my_number: The my_number of this OuterComposite. # noqa: E501 - :type my_number: float - """ - - self._my_number = my_number - - @property - def my_string(self): - """Gets the my_string of this OuterComposite. # noqa: E501 - - - :return: The my_string of this OuterComposite. # noqa: E501 - :rtype: str - """ - return self._my_string - - @my_string.setter - def my_string(self, my_string): - """Sets the my_string of this OuterComposite. - - - :param my_string: The my_string of this OuterComposite. # noqa: E501 - :type my_string: str - """ - - self._my_string = my_string - - @property - def my_boolean(self): - """Gets the my_boolean of this OuterComposite. # noqa: E501 - - - :return: The my_boolean of this OuterComposite. # noqa: E501 - :rtype: bool - """ - return self._my_boolean - - @my_boolean.setter - def my_boolean(self, my_boolean): - """Sets the my_boolean of this OuterComposite. - - - :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 - :type my_boolean: bool - """ - - self._my_boolean = my_boolean - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterComposite): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterComposite): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py deleted file mode 100755 index 27cdfd1fb791..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnum(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - - allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnum - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnum): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnum): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py deleted file mode 100755 index 982e9599d0e5..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_default_value.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnumDefaultValue(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - - allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnumDefaultValue - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumDefaultValue): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnumDefaultValue): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py deleted file mode 100755 index 3feec9c5a5a2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnumInteger(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _0 = "0" - _1 = "1" - _2 = "2" - - allowable_values = [_0, _1, _2] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnumInteger - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumInteger): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnumInteger): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py deleted file mode 100755 index 6757a4d63674..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_enum_integer_default_value.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterEnumIntegerDefaultValue(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - _0 = "0" - _1 = "1" - _2 = "2" - - allowable_values = [_0, _1, _2] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """OuterEnumIntegerDefaultValue - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumIntegerDefaultValue): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterEnumIntegerDefaultValue): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_object_with_enum_property.py deleted file mode 100644 index b9572300b6f6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/outer_object_with_enum_property.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class OuterObjectWithEnumProperty(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'value': 'OuterEnumInteger' - } - - attribute_map = { - 'value': 'value' - } - - def __init__(self, value=None, local_vars_configuration=None): # noqa: E501 - """OuterObjectWithEnumProperty - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._value = None - self.discriminator = None - - self.value = value - - @property - def value(self): - """Gets the value of this OuterObjectWithEnumProperty. # noqa: E501 - - - :return: The value of this OuterObjectWithEnumProperty. # noqa: E501 - :rtype: OuterEnumInteger - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this OuterObjectWithEnumProperty. - - - :param value: The value of this OuterObjectWithEnumProperty. # noqa: E501 - :type value: OuterEnumInteger - """ - if self.local_vars_configuration.client_side_validation and value is None: # noqa: E501 - raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 - - self._value = value - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterObjectWithEnumProperty): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OuterObjectWithEnumProperty): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py deleted file mode 100755 index 22bb4a585e47..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/pet.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Pet(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'category': 'Category', - 'name': 'str', - 'photo_urls': 'list[str]', - 'tags': 'list[Tag]', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } - - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 - """Pet - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._category = None - self._name = None - self._photo_urls = None - self._tags = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - if category is not None: - self.category = category - self.name = name - self.photo_urls = photo_urls - if tags is not None: - self.tags = tags - if status is not None: - self.status = status - - @property - def id(self): - """Gets the id of this Pet. # noqa: E501 - - - :return: The id of this Pet. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Pet. - - - :param id: The id of this Pet. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def category(self): - """Gets the category of this Pet. # noqa: E501 - - - :return: The category of this Pet. # noqa: E501 - :rtype: Category - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Pet. - - - :param category: The category of this Pet. # noqa: E501 - :type category: Category - """ - - self._category = category - - @property - def name(self): - """Gets the name of this Pet. # noqa: E501 - - - :return: The name of this Pet. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Pet. - - - :param name: The name of this Pet. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. # noqa: E501 - - - :return: The photo_urls of this Pet. # noqa: E501 - :rtype: list[str] - """ - return self._photo_urls - - @photo_urls.setter - def photo_urls(self, photo_urls): - """Sets the photo_urls of this Pet. - - - :param photo_urls: The photo_urls of this Pet. # noqa: E501 - :type photo_urls: list[str] - """ - if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 - raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 - - self._photo_urls = photo_urls - - @property - def tags(self): - """Gets the tags of this Pet. # noqa: E501 - - - :return: The tags of this Pet. # noqa: E501 - :rtype: list[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Pet. - - - :param tags: The tags of this Pet. # noqa: E501 - :type tags: list[Tag] - """ - - self._tags = tags - - @property - def status(self): - """Gets the status of this Pet. # noqa: E501 - - pet status in the store # noqa: E501 - - :return: The status of this Pet. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Pet. - - pet status in the store # noqa: E501 - - :param status: The status of this Pet. # noqa: E501 - :type status: str - """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Pet): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Pet): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py deleted file mode 100755 index c2888eba7500..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/read_only_first.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class ReadOnlyFirst(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bar': 'str', - 'baz': 'str' - } - - attribute_map = { - 'bar': 'bar', - 'baz': 'baz' - } - - def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._bar = None - self._baz = None - self.discriminator = None - - if bar is not None: - self.bar = bar - if baz is not None: - self.baz = baz - - @property - def bar(self): - """Gets the bar of this ReadOnlyFirst. # noqa: E501 - - - :return: The bar of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._bar - - @bar.setter - def bar(self, bar): - """Sets the bar of this ReadOnlyFirst. - - - :param bar: The bar of this ReadOnlyFirst. # noqa: E501 - :type bar: str - """ - - self._bar = bar - - @property - def baz(self): - """Gets the baz of this ReadOnlyFirst. # noqa: E501 - - - :return: The baz of this ReadOnlyFirst. # noqa: E501 - :rtype: str - """ - return self._baz - - @baz.setter - def baz(self, baz): - """Sets the baz of this ReadOnlyFirst. - - - :param baz: The baz of this ReadOnlyFirst. # noqa: E501 - :type baz: str - """ - - self._baz = baz - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ReadOnlyFirst): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ReadOnlyFirst): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/single_ref_type.py deleted file mode 100644 index a4aad0b8a070..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/single_ref_type.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SingleRefType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - ADMIN = "admin" - USER = "user" - - allowable_values = [ADMIN, USER] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """SingleRefType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SingleRefType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SingleRefType): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py deleted file mode 100755 index 4c848e1887c0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_model_name.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialModelName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'special_property_name': 'int' - } - - attribute_map = { - 'special_property_name': '$special[property.name]' - } - - def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._special_property_name = None - self.discriminator = None - - if special_property_name is not None: - self.special_property_name = special_property_name - - @property - def special_property_name(self): - """Gets the special_property_name of this SpecialModelName. # noqa: E501 - - - :return: The special_property_name of this SpecialModelName. # noqa: E501 - :rtype: int - """ - return self._special_property_name - - @special_property_name.setter - def special_property_name(self, special_property_name): - """Sets the special_property_name of this SpecialModelName. - - - :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 - :type special_property_name: int - """ - - self._special_property_name = special_property_name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialModelName): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialModelName): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py deleted file mode 100755 index a3e6789078d8..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/tag.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class Tag(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 - """Tag - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - - :return: The id of this Tag. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - - :return: The name of this Tag. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - - :param name: The name of this Tag. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Tag): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py deleted file mode 100755 index 7ae2898f6c5a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/user.py +++ /dev/null @@ -1,315 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class User(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int' - } - - attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } - - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 - """User - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._username = None - self._first_name = None - self._last_name = None - self._email = None - self._password = None - self._phone = None - self._user_status = None - self.discriminator = None - - if id is not None: - self.id = id - if username is not None: - self.username = username - if first_name is not None: - self.first_name = first_name - if last_name is not None: - self.last_name = last_name - if email is not None: - self.email = email - if password is not None: - self.password = password - if phone is not None: - self.phone = phone - if user_status is not None: - self.user_status = user_status - - @property - def id(self): - """Gets the id of this User. # noqa: E501 - - - :return: The id of this User. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this User. - - - :param id: The id of this User. # noqa: E501 - :type id: int - """ - - self._id = id - - @property - def username(self): - """Gets the username of this User. # noqa: E501 - - - :return: The username of this User. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this User. - - - :param username: The username of this User. # noqa: E501 - :type username: str - """ - - self._username = username - - @property - def first_name(self): - """Gets the first_name of this User. # noqa: E501 - - - :return: The first_name of this User. # noqa: E501 - :rtype: str - """ - return self._first_name - - @first_name.setter - def first_name(self, first_name): - """Sets the first_name of this User. - - - :param first_name: The first_name of this User. # noqa: E501 - :type first_name: str - """ - - self._first_name = first_name - - @property - def last_name(self): - """Gets the last_name of this User. # noqa: E501 - - - :return: The last_name of this User. # noqa: E501 - :rtype: str - """ - return self._last_name - - @last_name.setter - def last_name(self, last_name): - """Sets the last_name of this User. - - - :param last_name: The last_name of this User. # noqa: E501 - :type last_name: str - """ - - self._last_name = last_name - - @property - def email(self): - """Gets the email of this User. # noqa: E501 - - - :return: The email of this User. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this User. - - - :param email: The email of this User. # noqa: E501 - :type email: str - """ - - self._email = email - - @property - def password(self): - """Gets the password of this User. # noqa: E501 - - - :return: The password of this User. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this User. - - - :param password: The password of this User. # noqa: E501 - :type password: str - """ - - self._password = password - - @property - def phone(self): - """Gets the phone of this User. # noqa: E501 - - - :return: The phone of this User. # noqa: E501 - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this User. - - - :param phone: The phone of this User. # noqa: E501 - :type phone: str - """ - - self._phone = phone - - @property - def user_status(self): - """Gets the user_status of this User. # noqa: E501 - - User Status # noqa: E501 - - :return: The user_status of this User. # noqa: E501 - :rtype: int - """ - return self._user_status - - @user_status.setter - def user_status(self, user_status): - """Sets the user_status of this User. - - User Status # noqa: E501 - - :param user_status: The user_status of this User. # noqa: E501 - :type user_status: int - """ - - self._user_status = user_status - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, User): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, User): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py deleted file mode 100755 index a9aa12156fc2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/rest.py +++ /dev/null @@ -1,301 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import io -import json -import logging -import re -import ssl - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode -import urllib3 - -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) diff --git a/samples/openapi3/client/petstore/python-legacy/pom.xml b/samples/openapi3/client/petstore/python-legacy/pom.xml deleted file mode 100755 index 3a9cf7273065..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonLegacyOAS3PetstoreTests - pom - 1.0-SNAPSHOT - Python OpenAPI3 Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test-all - - - - - - - - diff --git a/samples/openapi3/client/petstore/python-legacy/requirements.txt b/samples/openapi3/client/petstore/python-legacy/requirements.txt deleted file mode 100755 index d0518ec800e9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/openapi3/client/petstore/python-legacy/setup.cfg b/samples/openapi3/client/petstore/python-legacy/setup.cfg deleted file mode 100755 index 11433ee875ab..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-legacy/setup.py b/samples/openapi3/client/petstore/python-legacy/setup.py deleted file mode 100755 index 58abfa11b8df..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description_content_type='text/markdown', - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/openapi3/client/petstore/python-legacy/test-requirements.txt b/samples/openapi3/client/petstore/python-legacy/test-requirements.txt deleted file mode 100755 index 96e37c87e984..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<'3.0' diff --git a/samples/openapi3/client/petstore/python-legacy/test/__init__.py b/samples/openapi3/client/petstore/python-legacy/test/__init__.py deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py deleted file mode 100644 index 4383ae1726b8..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_additional_properties_class.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test AdditionalPropertiesClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 - if include_optional : - return AdditionalPropertiesClass( - map_property = { - 'key' : '' - }, - map_of_map_property = { - 'key' : { - 'key' : '' - } - } - ) - else : - return AdditionalPropertiesClass( - ) - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-legacy/test/test_all_of_with_single_ref.py deleted file mode 100644 index ee761ef82d0a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_all_of_with_single_ref.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501 -from petstore_api.rest import ApiException - -class TestAllOfWithSingleRef(unittest.TestCase): - """AllOfWithSingleRef unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test AllOfWithSingleRef - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501 - if include_optional : - return AllOfWithSingleRef( - username = '', - single_ref_type = None - ) - else : - return AllOfWithSingleRef( - ) - - def testAllOfWithSingleRef(self): - """Test AllOfWithSingleRef""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_animal.py b/samples/openapi3/client/petstore/python-legacy/test/test_animal.py deleted file mode 100644 index d209151de678..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_animal.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Animal - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.animal.Animal() # noqa: E501 - if include_optional : - return Animal( - class_name = '', - color = 'red' - ) - else : - return Animal( - class_name = '', - ) - - def testAnimal(self): - """Test Animal""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py deleted file mode 100644 index d95798cfc5a4..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_another_fake_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_call_123_test_special_tags(self): - """Test case for call_123_test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py deleted file mode 100644 index 95efd33bce57..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_api_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ApiResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 - if include_optional : - return ApiResponse( - code = 56, - type = '', - message = '' - ) - else : - return ApiResponse( - ) - - def testApiResponse(self): - """Test ApiResponse""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py deleted file mode 100644 index 001b4e565737..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ArrayOfArrayOfNumberOnly - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 - if include_optional : - return ArrayOfArrayOfNumberOnly( - array_array_number = [ - [ - 1.337 - ] - ] - ) - else : - return ArrayOfArrayOfNumberOnly( - ) - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py deleted file mode 100644 index a35703ae0dac..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_array_of_number_only.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ArrayOfNumberOnly - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 - if include_optional : - return ArrayOfNumberOnly( - array_number = [ - 1.337 - ] - ) - else : - return ArrayOfNumberOnly( - ) - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py deleted file mode 100644 index 8327e415adcd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_array_test.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ArrayTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 - if include_optional : - return ArrayTest( - array_of_string = [ - '' - ], - array_array_of_integer = [ - [ - 56 - ] - ], - array_array_of_model = [ - [ - petstore_api.models.read_only_first.ReadOnlyFirst( - bar = '', - baz = '', ) - ] - ] - ) - else : - return ArrayTest( - ) - - def testArrayTest(self): - """Test ArrayTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py b/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py deleted file mode 100644 index c7a9721dbc00..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_capitalization.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Capitalization - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 - if include_optional : - return Capitalization( - small_camel = '', - capital_camel = '', - small_snake = '', - capital_snake = '', - sca_eth_flow_points = '', - att_name = '' - ) - else : - return Capitalization( - ) - - def testCapitalization(self): - """Test Capitalization""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_cat.py b/samples/openapi3/client/petstore/python-legacy/test/test_cat.py deleted file mode 100644 index e04566b1aafd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_cat.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py deleted file mode 100644 index 4708bf8bba3e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_cat_all_of.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CatAllOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 - if include_optional : - return CatAllOf( - declawed = True - ) - else : - return CatAllOf( - ) - - def testCatAllOf(self): - """Test CatAllOf""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_category.py b/samples/openapi3/client/petstore/python-legacy/test/test_category.py deleted file mode 100644 index 9b8a8faa0976..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_category.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Category - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.category.Category() # noqa: E501 - if include_optional : - return Category( - id = 56, - name = 'default-name' - ) - else : - return Category( - name = 'default-name', - ) - - def testCategory(self): - """Test Category""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py b/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py deleted file mode 100644 index 511843f2dcfd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_class_model.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ClassModel - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 - if include_optional : - return ClassModel( - _class = '' - ) - else : - return ClassModel( - ) - - def testClassModel(self): - """Test ClassModel""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_client.py b/samples/openapi3/client/petstore/python-legacy/test/test_client.py deleted file mode 100644 index 9209bb2c3f03..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_client.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Client - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.client.Client() # noqa: E501 - if include_optional : - return Client( - client = '' - ) - else : - return Client( - ) - - def testClient(self): - """Test Client""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_configuration.py b/samples/openapi3/client/petstore/python-legacy/test/test_configuration.py deleted file mode 100755 index d41ffa63ba8a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_configuration.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api import Configuration # noqa: E501 -from petstore_api.rest import ApiException - - -class TestConfiguration(unittest.TestCase): - """Configuration unit test stubs""" - - def setUp(self): - self.config= Configuration() - - def tearDown(self): - pass - - def test_configuration(self): - """Test configuration - - Test host settings # noqa: E501 - """ - host_settings = self.config.get_host_settings() - - self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url']) - self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value']) - - self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url']) - self.assertEqual('v2', host_settings[1]['variables']['version']['default_value']) - - def test_get_host_from_settings(self): - """ Test get_host_from_settings - - Test get URL from host settings - """ - self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0)) - self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'})) - self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'})) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_default_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_default_api.py deleted file mode 100644 index 50e7c57bd0bf..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_default_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.default_api import DefaultApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 - - def tearDown(self): - pass - - def test_foo_get(self): - """Test case for foo_get - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_deprecated_object.py b/samples/openapi3/client/petstore/python-legacy/test/test_deprecated_object.py deleted file mode 100644 index 50257271cd72..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_deprecated_object.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501 -from petstore_api.rest import ApiException - -class TestDeprecatedObject(unittest.TestCase): - """DeprecatedObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DeprecatedObject - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501 - if include_optional : - return DeprecatedObject( - name = '' - ) - else : - return DeprecatedObject( - ) - - def testDeprecatedObject(self): - """Test DeprecatedObject""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_dog.py b/samples/openapi3/client/petstore/python-legacy/test/test_dog.py deleted file mode 100644 index af75161287e1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_dog.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.dog import Dog # noqa: E501 -from petstore_api.rest import ApiException - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py deleted file mode 100644 index 44a266577a41..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_dog_all_of.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DogAllOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 - if include_optional : - return DogAllOf( - breed = '' - ) - else : - return DogAllOf( - ) - - def testDogAllOf(self): - """Test DogAllOf""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py deleted file mode 100644 index 31aae13158ed..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_enum_arrays.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test EnumArrays - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - if include_optional : - return EnumArrays( - just_symbol = '>=', - array_enum = [ - 'fish' - ] - ) - else : - return EnumArrays( - ) - - def testEnumArrays(self): - """Test EnumArrays""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py deleted file mode 100644 index 5d7e2c398977..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_enum_class.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test EnumClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - if include_optional : - return EnumClass( - ) - else : - return EnumClass( - ) - - def testEnumClass(self): - """Test EnumClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py deleted file mode 100644 index 88a9614dd548..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_enum_test.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test EnumTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 - if include_optional : - return EnumTest( - enum_string = 'UPPER', - enum_string_required = 'UPPER', - enum_integer = 1, - enum_number = 1.1, - outer_enum = 'placed', - outer_enum_integer = 0, - outer_enum_default_value = 'placed', - outer_enum_integer_default_value = 0 - ) - else : - return EnumTest( - enum_string_required = 'UPPER', - ) - - def testEnumTest(self): - """Test EnumTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py deleted file mode 100644 index a485b1f91c98..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -try: - from unittest.mock import patch -except ImportError: - from mock import patch - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_fake_health_get(self): - """Test case for fake_health_get - - Health check endpoint # noqa: E501 - """ - pass - - def test_fake_http_signature_test(self): - """Test case for fake_http_signature_test - - test http signature authentication # noqa: E501 - """ - pass - - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize - - """ - pass - - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize - - """ - pass - - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize - - """ - pass - - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize - - """ - pass - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - def test_test_query_parameter_collection_format(self): - """Test case for test_query_parameter_collection_format - - """ - pass - - def test_headers_parameter(self): - """Test case for the _headers are passed by the user - - To test any optional parameter # noqa: E501 - """ - api = petstore_api.api.PetApi() - with patch("petstore_api.api_client.ApiClient.call_api") as mock_method: - value_headers = {"Header1": "value1"} - api.find_pets_by_status(["Cat"], _headers=value_headers) - args, _ = mock_method.call_args - self.assertEqual(args, ('/pet/findByStatus', 'GET', {}, [('status', ['Cat'])], {'Accept': 'application/json', 'Header1': 'value1'}) -) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_file.py b/samples/openapi3/client/petstore/python-legacy/test/test_file.py deleted file mode 100644 index 3c9b91972d91..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_file.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test File - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.file.File() # noqa: E501 - if include_optional : - return File( - source_uri = '' - ) - else : - return File( - ) - - def testFile(self): - """Test File""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py deleted file mode 100644 index 2834ddc05413..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_file_schema_test_class.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FileSchemaTestClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - if include_optional : - return FileSchemaTestClass( - file = petstore_api.models.file.File( - source_uri = '', ), - files = [ - petstore_api.models.file.File( - source_uri = '', ) - ] - ) - else : - return FileSchemaTestClass( - ) - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_foo.py b/samples/openapi3/client/petstore/python-legacy/test/test_foo.py deleted file mode 100644 index f592b1c37018..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_foo.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.foo import Foo # noqa: E501 -from petstore_api.rest import ApiException - -class TestFoo(unittest.TestCase): - """Foo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Foo - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.foo.Foo() # noqa: E501 - if include_optional : - return Foo( - bar = 'bar' - ) - else : - return Foo( - ) - - def testFoo(self): - """Test Foo""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_foo_get_default_response.py deleted file mode 100644 index d2cadc258d8e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_foo_get_default_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501 -from petstore_api.rest import ApiException - -class TestFooGetDefaultResponse(unittest.TestCase): - """FooGetDefaultResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FooGetDefaultResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501 - if include_optional : - return FooGetDefaultResponse( - string = petstore_api.models.foo.Foo( - bar = 'bar', ) - ) - else : - return FooGetDefaultResponse( - ) - - def testFooGetDefaultResponse(self): - """Test FooGetDefaultResponse""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py deleted file mode 100644 index b21dd314879c..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_format_test.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FormatTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - if include_optional : - return FormatTest( - integer = 10, - int32 = 20, - int64 = 56, - number = 32.1, - float = 54.3, - double = 67.8, - decimal = 1, - string = 'a', - byte = 'YQ==', - binary = bytes(b'blah'), - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84', - password = '0123456789', - pattern_with_digits = '0480728880', - pattern_with_digits_and_delimiter = 'image_480' - ) - else : - return FormatTest( - number = 32.1, - byte = 'YQ==', - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - password = '0123456789', - ) - - def testFormatTest(self): - """Test FormatTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py deleted file mode 100644 index 2a8d2df6a0f8..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_has_only_read_only.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test HasOnlyReadOnly - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 - if include_optional : - return HasOnlyReadOnly( - bar = '', - foo = '' - ) - else : - return HasOnlyReadOnly( - ) - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py deleted file mode 100644 index 21c52053ea22..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_health_check_result.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501 -from petstore_api.rest import ApiException - -class TestHealthCheckResult(unittest.TestCase): - """HealthCheckResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test HealthCheckResult - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501 - if include_optional : - return HealthCheckResult( - nullable_message = '' - ) - else : - return HealthCheckResult( - ) - - def testHealthCheckResult(self): - """Test HealthCheckResult""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py deleted file mode 100644 index b2569c80b8f7..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object import InlineObject # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject(unittest.TestCase): - """InlineObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object.InlineObject() # noqa: E501 - if include_optional : - return InlineObject( - name = '', - status = '' - ) - else : - return InlineObject( - ) - - def testInlineObject(self): - """Test InlineObject""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py deleted file mode 100644 index 548e61b7ce22..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object1.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject1(unittest.TestCase): - """InlineObject1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject1 - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501 - if include_optional : - return InlineObject1( - additional_metadata = '', - file = bytes(b'blah') - ) - else : - return InlineObject1( - ) - - def testInlineObject1(self): - """Test InlineObject1""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py deleted file mode 100644 index 749e24ebb8d0..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object2.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject2(unittest.TestCase): - """InlineObject2 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject2 - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501 - if include_optional : - return InlineObject2( - enum_form_string_array = [ - '$' - ], - enum_form_string = '-efg' - ) - else : - return InlineObject2( - ) - - def testInlineObject2(self): - """Test InlineObject2""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py deleted file mode 100644 index a4a7e8e11af2..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object3.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject3(unittest.TestCase): - """InlineObject3 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject3 - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501 - if include_optional : - return InlineObject3( - integer = 10, - int32 = 20, - int64 = 56, - number = 32.1, - float = 1.337, - double = 67.8, - string = 'a', - pattern_without_delimiter = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>', - byte = 'YQ==', - binary = bytes(b'blah'), - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - password = '0123456789', - callback = '' - ) - else : - return InlineObject3( - number = 32.1, - double = 67.8, - pattern_without_delimiter = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>', - byte = 'YQ==', - ) - - def testInlineObject3(self): - """Test InlineObject3""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py deleted file mode 100644 index 6212dff6e6e9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object4.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject4(unittest.TestCase): - """InlineObject4 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject4 - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501 - if include_optional : - return InlineObject4( - param = '', - param2 = '' - ) - else : - return InlineObject4( - param = '', - param2 = '', - ) - - def testInlineObject4(self): - """Test InlineObject4""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py deleted file mode 100644 index 62b39f159423..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_object5.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineObject5(unittest.TestCase): - """InlineObject5 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineObject5 - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501 - if include_optional : - return InlineObject5( - additional_metadata = '', - required_file = bytes(b'blah') - ) - else : - return InlineObject5( - required_file = bytes(b'blah'), - ) - - def testInlineObject5(self): - """Test InlineObject5""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py deleted file mode 100644 index dfb772dbe61a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_inline_response_default.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501 -from petstore_api.rest import ApiException - -class TestInlineResponseDefault(unittest.TestCase): - """InlineResponseDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InlineResponseDefault - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501 - if include_optional : - return InlineResponseDefault( - string = petstore_api.models.foo.Foo( - bar = 'bar', ) - ) - else : - return InlineResponseDefault( - ) - - def testInlineResponseDefault(self): - """Test InlineResponseDefault""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_list.py b/samples/openapi3/client/petstore/python-legacy/test/test_list.py deleted file mode 100644 index 4c603a5e9b1e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_list.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test List - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.list.List() # noqa: E501 - if include_optional : - return List( - _123_list = '' - ) - else : - return List( - ) - - def testList(self): - """Test List""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py b/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py deleted file mode 100644 index 71608e979f81..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_map_test.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MapTest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - if include_optional : - return MapTest( - map_map_of_string = { - 'key' : { - 'key' : '' - } - }, - map_of_enum_string = { - 'UPPER' : 'UPPER' - }, - direct_map = { - 'key' : True - }, - indirect_map = { - 'key' : True - } - ) - else : - return MapTest( - ) - - def testMapTest(self): - """Test MapTest""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index d217b1143656..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MixedPropertiesAndAdditionalPropertiesClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - if include_optional : - return MixedPropertiesAndAdditionalPropertiesClass( - uuid = '', - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - map = { - 'key' : petstore_api.models.animal.Animal( - class_name = '', - color = 'red', ) - } - ) - else : - return MixedPropertiesAndAdditionalPropertiesClass( - ) - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py deleted file mode 100644 index f7e9677e0074..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_model200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Model200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 - if include_optional : - return Model200Response( - name = 56, - _class = '' - ) - else : - return Model200Response( - ) - - def testModel200Response(self): - """Test Model200Response""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_model_200_response.py b/samples/openapi3/client/petstore/python-legacy/test/test_model_200_response.py deleted file mode 100644 index 314ee5e3dde6..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_model_200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model_200_response import Model_200Response # noqa: E501 -from petstore_api.rest import ApiException - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Model_200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model_200_response.Model_200Response() # noqa: E501 - if include_optional : - return Model_200Response( - name = 56, - _class = '' - ) - else : - return Model_200Response( - ) - - def testModel_200Response(self): - """Test Model_200Response""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py b/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py deleted file mode 100644 index b0f9d9c4f7f9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_model_return.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ModelReturn - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 - if include_optional : - return ModelReturn( - _return = 56 - ) - else : - return ModelReturn( - ) - - def testModelReturn(self): - """Test ModelReturn""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_name.py b/samples/openapi3/client/petstore/python-legacy/test/test_name.py deleted file mode 100644 index bbf11fd231ea..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_name.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Name - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.name.Name() # noqa: E501 - if include_optional : - return Name( - name = 56, - snake_case = 56, - _property = '', - _123_number = 56 - ) - else : - return Name( - name = 56, - ) - - def testName(self): - """Test Name""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py deleted file mode 100644 index f570c74fc052..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_nullable_class.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.nullable_class import NullableClass # noqa: E501 -from petstore_api.rest import ApiException - -class TestNullableClass(unittest.TestCase): - """NullableClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test NullableClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501 - if include_optional : - return NullableClass( - integer_prop = 56, - number_prop = 1.337, - boolean_prop = True, - string_prop = '', - date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - array_nullable_prop = [ - None - ], - array_and_items_nullable_prop = [ - None - ], - array_items_nullable = [ - None - ], - object_nullable_prop = { - 'key' : None - }, - object_and_items_nullable_prop = { - 'key' : None - }, - object_items_nullable = { - 'key' : None - } - ) - else : - return NullableClass( - ) - - def testNullableClass(self): - """Test NullableClass""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py b/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py deleted file mode 100644 index 776946c3d774..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_number_only.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test NumberOnly - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 - if include_optional : - return NumberOnly( - just_number = 1.337 - ) - else : - return NumberOnly( - ) - - def testNumberOnly(self): - """Test NumberOnly""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-legacy/test/test_object_with_deprecated_fields.py deleted file mode 100644 index e0cbf3e98a51..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_object_with_deprecated_fields.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501 -from petstore_api.rest import ApiException - -class TestObjectWithDeprecatedFields(unittest.TestCase): - """ObjectWithDeprecatedFields unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ObjectWithDeprecatedFields - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501 - if include_optional : - return ObjectWithDeprecatedFields( - uuid = '', - id = 1.337, - deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject( - name = '', ), - bars = [ - 'bar' - ] - ) - else : - return ObjectWithDeprecatedFields( - ) - - def testObjectWithDeprecatedFields(self): - """Test ObjectWithDeprecatedFields""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_order.py b/samples/openapi3/client/petstore/python-legacy/test/test_order.py deleted file mode 100644 index d6ec36f83a0d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_order.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Order - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.order.Order() # noqa: E501 - if include_optional : - return Order( - id = 56, - pet_id = 56, - quantity = 56, - ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - status = 'placed', - complete = True - ) - else : - return Order( - ) - - def testOrder(self): - """Test Order""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py deleted file mode 100644 index c6fd58849377..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_composite.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterComposite - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 - if include_optional : - return OuterComposite( - my_number = 1.337, - my_string = '', - my_boolean = True - ) - else : - return OuterComposite( - ) - - def testOuterComposite(self): - """Test OuterComposite""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py deleted file mode 100644 index 6e3ed657f709..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterEnum - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - if include_optional : - return OuterEnum( - ) - else : - return OuterEnum( - ) - - def testOuterEnum(self): - """Test OuterEnum""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py deleted file mode 100644 index 640ceb335458..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_default_value.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterEnumDefaultValue(unittest.TestCase): - """OuterEnumDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterEnumDefaultValue - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501 - if include_optional : - return OuterEnumDefaultValue( - ) - else : - return OuterEnumDefaultValue( - ) - - def testOuterEnumDefaultValue(self): - """Test OuterEnumDefaultValue""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py deleted file mode 100644 index 7faf5baa6c99..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterEnumInteger(unittest.TestCase): - """OuterEnumInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterEnumInteger - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501 - if include_optional : - return OuterEnumInteger( - ) - else : - return OuterEnumInteger( - ) - - def testOuterEnumInteger(self): - """Test OuterEnumInteger""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py deleted file mode 100644 index 5a83017f7f46..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_enum_integer_default_value.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterEnumIntegerDefaultValue(unittest.TestCase): - """OuterEnumIntegerDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterEnumIntegerDefaultValue - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501 - if include_optional : - return OuterEnumIntegerDefaultValue( - ) - else : - return OuterEnumIntegerDefaultValue( - ) - - def testOuterEnumIntegerDefaultValue(self): - """Test OuterEnumIntegerDefaultValue""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-legacy/test/test_outer_object_with_enum_property.py deleted file mode 100644 index 81fb183aedc9..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_outer_object_with_enum_property.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501 -from petstore_api.rest import ApiException - -class TestOuterObjectWithEnumProperty(unittest.TestCase): - """OuterObjectWithEnumProperty unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test OuterObjectWithEnumProperty - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501 - if include_optional : - return OuterObjectWithEnumProperty( - value = 2 - ) - else : - return OuterObjectWithEnumProperty( - value = 2, - ) - - def testOuterObjectWithEnumProperty(self): - """Test OuterObjectWithEnumProperty""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_pet.py b/samples/openapi3/client/petstore/python-legacy/test/test_pet.py deleted file mode 100644 index 6d3fd2f35b04..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_pet.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Pet - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.pet.Pet() # noqa: E501 - if include_optional : - return Pet( - id = 56, - category = petstore_api.models.category.Category( - id = 56, - name = 'default-name', ), - name = 'doggie', - photo_urls = [ - '' - ], - tags = [ - petstore_api.models.tag.Tag( - id = 56, - name = '', ) - ], - status = 'available' - ) - else : - return Pet( - name = 'doggie', - photo_urls = [ - '' - ], - ) - - def testPet(self): - """Test Pet""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py deleted file mode 100644 index 77665df879f1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_pet_api.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - def test_upload_file_with_required_file(self): - """Test case for upload_file_with_required_file - - uploads an image (required) # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py deleted file mode 100644 index 310e4b1aebbe..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_read_only_first.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ReadOnlyFirst - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 - if include_optional : - return ReadOnlyFirst( - bar = '', - baz = '' - ) - else : - return ReadOnlyFirst( - ) - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_single_ref_type.py b/samples/openapi3/client/petstore/python-legacy/test/test_single_ref_type.py deleted file mode 100644 index 66b9e0075fbd..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_single_ref_type.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.single_ref_type import SingleRefType # noqa: E501 -from petstore_api.rest import ApiException - -class TestSingleRefType(unittest.TestCase): - """SingleRefType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test SingleRefType - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.single_ref_type.SingleRefType() # noqa: E501 - if include_optional : - return SingleRefType( - ) - else : - return SingleRefType( - ) - - def testSingleRefType(self): - """Test SingleRefType""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py deleted file mode 100644 index eb487cd42fc1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_special_model_name.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test SpecialModelName - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 - if include_optional : - return SpecialModelName( - special_property_name = 56 - ) - else : - return SpecialModelName( - ) - - def testSpecialModelName(self): - """Test SpecialModelName""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_store_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_store_api.py deleted file mode 100644 index 81848d24a67e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_store_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_tag.py b/samples/openapi3/client/petstore/python-legacy/test/test_tag.py deleted file mode 100644 index 9680300032f1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_tag.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Tag - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.tag.Tag() # noqa: E501 - if include_optional : - return Tag( - id = 56, - name = '' - ) - else : - return Tag( - ) - - def testTag(self): - """Test Tag""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_user.py b/samples/openapi3/client/petstore/python-legacy/test/test_user.py deleted file mode 100644 index 174c8e06be5d..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_user.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test User - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.user.User() # noqa: E501 - if include_optional : - return User( - id = 56, - username = '', - first_name = '', - last_name = '', - email = '', - password = '', - phone = '', - user_status = 56 - ) - else : - return User( - ) - - def testUser(self): - """Test User""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_user_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_user_api.py deleted file mode 100644 index 6df730fba2b1..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_user_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test_python2.sh b/samples/openapi3/client/petstore/python-legacy/test_python2.sh deleted file mode 100755 index 722b3ee5e235..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test_python2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -l -tox -e py27 || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi - diff --git a/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh deleted file mode 100755 index ef758bd4450a..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/openapi3/client/petstore/python-legacy/tox.ini b/samples/openapi3/client/petstore/python-legacy/tox.ini deleted file mode 100755 index 169d895329bf..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py27, py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python-prior/.gitignore b/samples/openapi3/client/petstore/python-prior/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml deleted file mode 100644 index 9e84f5176163..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -# ref: https://docs.gitlab.com/ee/ci/README.html - -stages: - - test - -.tests: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=petstore_api - -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests - image: python:3.7-alpine -test-3.8: - extends: .tests - image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES deleted file mode 100644 index aa32ba2deeb9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES +++ /dev/null @@ -1,236 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesWithArrayOfEnums.md -docs/Address.md -docs/Animal.md -docs/AnimalFarm.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/Apple.md -docs/AppleReq.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfEnums.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Banana.md -docs/BananaReq.md -docs/BasquePig.md -docs/BooleanEnum.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ChildCat.md -docs/ChildCatAllOf.md -docs/ClassModel.md -docs/Client.md -docs/ComplexQuadrilateral.md -docs/ComposedOneOfNumberWithValidations.md -docs/ComposedSchemaWithPropsAndNoAddProps.md -docs/DanishPig.md -docs/DefaultApi.md -docs/Dog.md -docs/DogAllOf.md -docs/Drawing.md -docs/EgressThresholdOptions.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/EquilateralTriangle.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FooGetDefaultResponse.md -docs/FooObject.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/GmFruitNoProperties.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineAdditionalPropertiesRefPayload.md -docs/IntegerEnum.md -docs/IntegerEnumOneValue.md -docs/IntegerEnumWithDefaultValue.md -docs/IsoscelesTriangle.md -docs/Legs.md -docs/List.md -docs/Mammal.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Mole.md -docs/Name.md -docs/NullableClass.md -docs/NullableShape.md -docs/NumberOnly.md -docs/NumberWithValidations.md -docs/ObjectInterface.md -docs/ObjectModelWithRefProps.md -docs/ObjectWithValidations.md -docs/Order.md -docs/ParentPet.md -docs/Pet.md -docs/PetApi.md -docs/Pig.md -docs/PostInlineAdditionalPropertiesPayloadRequest.md -docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md -docs/PublishOptions.md -docs/PublishOptionsPublish.md -docs/Quadrilateral.md -docs/QuadrilateralInterface.md -docs/ReadOnlyFirst.md -docs/Readonly.md -docs/ScaleneTriangle.md -docs/Shape.md -docs/ShapeInterface.md -docs/ShapeOrNull.md -docs/SimpleQuadrilateral.md -docs/SomeObject.md -docs/SomeObjectWithSelfAttr.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/StreamOptions.md -docs/StringBooleanMap.md -docs/StringEnum.md -docs/StringEnumWithDefaultValue.md -docs/Tag.md -docs/Triangle.md -docs/TriangleInterface.md -docs/User.md -docs/UserApi.md -docs/Whale.md -docs/Zebra.md -git_push.sh -petstore_api/__init__.py -petstore_api/api/__init__.py -petstore_api/api/another_fake_api.py -petstore_api/api/default_api.py -petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags123_api.py -petstore_api/api/pet_api.py -petstore_api/api/store_api.py -petstore_api/api/user_api.py -petstore_api/api_client.py -petstore_api/apis/__init__.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/model/__init__.py -petstore_api/model/additional_properties_class.py -petstore_api/model/additional_properties_with_array_of_enums.py -petstore_api/model/address.py -petstore_api/model/animal.py -petstore_api/model/animal_farm.py -petstore_api/model/api_response.py -petstore_api/model/apple.py -petstore_api/model/apple_req.py -petstore_api/model/array_of_array_of_number_only.py -petstore_api/model/array_of_enums.py -petstore_api/model/array_of_number_only.py -petstore_api/model/array_test.py -petstore_api/model/banana.py -petstore_api/model/banana_req.py -petstore_api/model/basque_pig.py -petstore_api/model/boolean_enum.py -petstore_api/model/capitalization.py -petstore_api/model/cat.py -petstore_api/model/cat_all_of.py -petstore_api/model/category.py -petstore_api/model/child_cat.py -petstore_api/model/child_cat_all_of.py -petstore_api/model/class_model.py -petstore_api/model/client.py -petstore_api/model/complex_quadrilateral.py -petstore_api/model/composed_one_of_number_with_validations.py -petstore_api/model/composed_schema_with_props_and_no_add_props.py -petstore_api/model/danish_pig.py -petstore_api/model/dog.py -petstore_api/model/dog_all_of.py -petstore_api/model/drawing.py -petstore_api/model/egress_threshold_options.py -petstore_api/model/enum_arrays.py -petstore_api/model/enum_class.py -petstore_api/model/enum_test.py -petstore_api/model/equilateral_triangle.py -petstore_api/model/file.py -petstore_api/model/file_schema_test_class.py -petstore_api/model/foo.py -petstore_api/model/foo_get_default_response.py -petstore_api/model/foo_object.py -petstore_api/model/format_test.py -petstore_api/model/fruit.py -petstore_api/model/fruit_req.py -petstore_api/model/gm_fruit.py -petstore_api/model/gm_fruit_no_properties.py -petstore_api/model/grandparent_animal.py -petstore_api/model/has_only_read_only.py -petstore_api/model/health_check_result.py -petstore_api/model/inline_additional_properties_ref_payload.py -petstore_api/model/integer_enum.py -petstore_api/model/integer_enum_one_value.py -petstore_api/model/integer_enum_with_default_value.py -petstore_api/model/isosceles_triangle.py -petstore_api/model/legs.py -petstore_api/model/list.py -petstore_api/model/mammal.py -petstore_api/model/map_test.py -petstore_api/model/mixed_properties_and_additional_properties_class.py -petstore_api/model/model200_response.py -petstore_api/model/model_return.py -petstore_api/model/mole.py -petstore_api/model/name.py -petstore_api/model/nullable_class.py -petstore_api/model/nullable_shape.py -petstore_api/model/number_only.py -petstore_api/model/number_with_validations.py -petstore_api/model/object_interface.py -petstore_api/model/object_model_with_ref_props.py -petstore_api/model/object_with_validations.py -petstore_api/model/order.py -petstore_api/model/parent_pet.py -petstore_api/model/pet.py -petstore_api/model/pig.py -petstore_api/model/post_inline_additional_properties_payload_request.py -petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py -petstore_api/model/publish_options.py -petstore_api/model/publish_options_publish.py -petstore_api/model/quadrilateral.py -petstore_api/model/quadrilateral_interface.py -petstore_api/model/read_only_first.py -petstore_api/model/readonly.py -petstore_api/model/scalene_triangle.py -petstore_api/model/shape.py -petstore_api/model/shape_interface.py -petstore_api/model/shape_or_null.py -petstore_api/model/simple_quadrilateral.py -petstore_api/model/some_object.py -petstore_api/model/some_object_with_self_attr.py -petstore_api/model/special_model_name.py -petstore_api/model/stream_options.py -petstore_api/model/string_boolean_map.py -petstore_api/model/string_enum.py -petstore_api/model/string_enum_with_default_value.py -petstore_api/model/tag.py -petstore_api/model/triangle.py -petstore_api/model/triangle_interface.py -petstore_api/model/user.py -petstore_api/model/whale.py -petstore_api/model/zebra.py -petstore_api/model_utils.py -petstore_api/models/__init__.py -petstore_api/rest.py -petstore_api/signing.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -tox.ini diff --git a/samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-prior/.travis.yml b/samples/openapi3/client/petstore/python-prior/.travis.yml deleted file mode 100644 index 1fcc4b155964..000000000000 --- a/samples/openapi3/client/petstore/python-prior/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -# command to install dependencies -install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" -# command to run tests -script: pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python-prior/Makefile b/samples/openapi3/client/petstore/python-prior/Makefile deleted file mode 100644 index f8957d5ed65d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(SETUP_OUT) - rm -rf $(VENV) - rm -rf .tox - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -test: clean - bash ./test_python.sh diff --git a/samples/openapi3/client/petstore/python-prior/README.md b/samples/openapi3/client/petstore/python-prior/README.md deleted file mode 100644 index 6d29101bc156..000000000000 --- a/samples/openapi3/client/petstore/python-prior/README.md +++ /dev/null @@ -1,309 +0,0 @@ -# petstore-api -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen - -## Requirements. - -Python >=3.6 - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -import datetime -import time -import petstore_api -from pprint import pprint -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - client = Client( - client="client_example", - ) # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | -*FakeApi* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums -*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | -*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | -*FakeApi* | [**download_attachment**](docs/FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition -*FakeApi* | [**enum_test**](docs/FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums -*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal | -*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**post_inline_additional_properties_payload**](docs/FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload | -*FakeApi* | [**post_inline_additional_properties_ref_payload**](docs/FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload | -*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -*FakeApi* | [**tx_rx_all_of_model**](docs/FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | -*FakeApi* | [**tx_rx_any_of_model**](docs/FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | -*FakeApi* | [**upload_download_file**](docs/FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -*FakeApi* | [**upload_file**](docs/FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data -*FakeApi* | [**upload_files**](docs/FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) - - [Address](docs/Address.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [Apple](docs/Apple.md) - - [AppleReq](docs/AppleReq.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfEnums](docs/ArrayOfEnums.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Banana](docs/Banana.md) - - [BananaReq](docs/BananaReq.md) - - [BasquePig](docs/BasquePig.md) - - [BooleanEnum](docs/BooleanEnum.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ChildCat](docs/ChildCat.md) - - [ChildCatAllOf](docs/ChildCatAllOf.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) - - [ComposedSchemaWithPropsAndNoAddProps](docs/ComposedSchemaWithPropsAndNoAddProps.md) - - [DanishPig](docs/DanishPig.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [Drawing](docs/Drawing.md) - - [EgressThresholdOptions](docs/EgressThresholdOptions.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - - [FooObject](docs/FooObject.md) - - [FormatTest](docs/FormatTest.md) - - [Fruit](docs/Fruit.md) - - [FruitReq](docs/FruitReq.md) - - [GmFruit](docs/GmFruit.md) - - [GmFruitNoProperties](docs/GmFruitNoProperties.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineAdditionalPropertiesRefPayload](docs/InlineAdditionalPropertiesRefPayload.md) - - [IntegerEnum](docs/IntegerEnum.md) - - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) - - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) - - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [Legs](docs/Legs.md) - - [List](docs/List.md) - - [Mammal](docs/Mammal.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Mole](docs/Mole.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NullableShape](docs/NullableShape.md) - - [NumberOnly](docs/NumberOnly.md) - - [NumberWithValidations](docs/NumberWithValidations.md) - - [ObjectInterface](docs/ObjectInterface.md) - - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [ObjectWithValidations](docs/ObjectWithValidations.md) - - [Order](docs/Order.md) - - [ParentPet](docs/ParentPet.md) - - [Pet](docs/Pet.md) - - [Pig](docs/Pig.md) - - [PostInlineAdditionalPropertiesPayloadRequest](docs/PostInlineAdditionalPropertiesPayloadRequest.md) - - [PostInlineAdditionalPropertiesPayloadRequestArrayDataInner](docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) - - [PublishOptions](docs/PublishOptions.md) - - [PublishOptionsPublish](docs/PublishOptionsPublish.md) - - [Quadrilateral](docs/Quadrilateral.md) - - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Readonly](docs/Readonly.md) - - [ScaleneTriangle](docs/ScaleneTriangle.md) - - [Shape](docs/Shape.md) - - [ShapeInterface](docs/ShapeInterface.md) - - [ShapeOrNull](docs/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [SomeObject](docs/SomeObject.md) - - [SomeObjectWithSelfAttr](docs/SomeObjectWithSelfAttr.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StreamOptions](docs/StreamOptions.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [StringEnum](docs/StringEnum.md) - - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) - - [Tag](docs/Tag.md) - - [Triangle](docs/Triangle.md) - - [TriangleInterface](docs/TriangleInterface.md) - - [User](docs/User.md) - - [Whale](docs/Whale.md) - - [Zebra](docs/Zebra.md) - - - -## Documentation For Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -### bearer_test - -- **Type**: Bearer authentication (JWT) - - -### http_signature_test - -- **Type**: HTTP signature authentication - - -## Author - - - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from petstore_api.api.default_api import DefaultApi` -- `from petstore_api.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import petstore_api -from petstore_api.apis import * -from petstore_api.models import * -``` - diff --git a/samples/openapi3/client/petstore/python-prior/dev-requirements.txt b/samples/openapi3/client/petstore/python-prior/dev-requirements.txt deleted file mode 100644 index ccdfca629494..000000000000 --- a/samples/openapi3/client/petstore/python-prior/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md deleted file mode 100644 index b8d54e3c9bf1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,19 +0,0 @@ -# AdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **{str: (str,)}** | | [optional] -**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] -**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] -**map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**empty_map** | **dict** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] -**map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md deleted file mode 100644 index 5cdb2f4c9221..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesWithArrayOfEnums - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | [**[EnumClass]**](EnumClass.md) | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Address.md b/samples/openapi3/client/petstore/python-prior/docs/Address.md deleted file mode 100644 index 31b6c30f1ff8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Address.md +++ /dev/null @@ -1,11 +0,0 @@ -# Address - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Animal.md b/samples/openapi3/client/petstore/python-prior/docs/Animal.md deleted file mode 100644 index 2c3e499ed438..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Animal.md +++ /dev/null @@ -1,14 +0,0 @@ -# Animal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**tail** | **bool** | | [optional] [readonly] if omitted the server will use the default value of True -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md deleted file mode 100644 index fc299cf27d34..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md +++ /dev/null @@ -1,11 +0,0 @@ -# AnimalFarm - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**[Animal]**](Animal.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md deleted file mode 100644 index cd2bfcaa3b20..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md +++ /dev/null @@ -1,78 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import another_fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = another_fake_api.AnotherFakeApi(api_client) - client = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md deleted file mode 100644 index bedefea9a9cb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# ApiResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Apple.md b/samples/openapi3/client/petstore/python-prior/docs/Apple.md deleted file mode 100644 index d7634278906b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Apple.md +++ /dev/null @@ -1,13 +0,0 @@ -# Apple - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cultivar** | **str** | | -**origin** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/AppleReq.md b/samples/openapi3/client/petstore/python-prior/docs/AppleReq.md deleted file mode 100644 index b50f701a3d86..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/AppleReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# AppleReq - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cultivar** | **str** | | -**mealy** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 11cd25c98ee4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayOfArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **[[float]]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md deleted file mode 100644 index d2f8ea80a3d9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfEnums - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**[StringEnum]**](StringEnum.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 1e9bb12e4e8b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayOfNumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **[float]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md deleted file mode 100644 index 9eac1f8874c4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# ArrayTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **[str]** | | [optional] -**array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Banana.md b/samples/openapi3/client/petstore/python-prior/docs/Banana.md deleted file mode 100644 index 2e38614e0f83..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Banana.md +++ /dev/null @@ -1,12 +0,0 @@ -# Banana - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length_cm** | **float** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/BananaReq.md b/samples/openapi3/client/petstore/python-prior/docs/BananaReq.md deleted file mode 100644 index 737552882190..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/BananaReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# BananaReq - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length_cm** | **float** | | -**sweet** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/BasquePig.md b/samples/openapi3/client/petstore/python-prior/docs/BasquePig.md deleted file mode 100644 index 0d92ecbe02bb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/BasquePig.md +++ /dev/null @@ -1,12 +0,0 @@ -# BasquePig - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md b/samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md deleted file mode 100644 index ab7bdfff4268..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# BooleanEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **bool** | | defaults to True, must be one of [True, ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Capitalization.md b/samples/openapi3/client/petstore/python-prior/docs/Capitalization.md deleted file mode 100644 index df9989f8db57..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Capitalization.md +++ /dev/null @@ -1,17 +0,0 @@ -# Capitalization - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Cat.md b/samples/openapi3/client/petstore/python-prior/docs/Cat.md deleted file mode 100644 index 771510d15b81..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Cat.md +++ /dev/null @@ -1,15 +0,0 @@ -# Cat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**declawed** | **bool** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**tail** | **bool** | | [optional] [readonly] if omitted the server will use the default value of True -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md deleted file mode 100644 index 6fd1390a749b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# CatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Category.md b/samples/openapi3/client/petstore/python-prior/docs/Category.md deleted file mode 100644 index 7650eccafba5..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Category.md +++ /dev/null @@ -1,13 +0,0 @@ -# Category - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | defaults to "default-name" -**id** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ChildCat.md b/samples/openapi3/client/petstore/python-prior/docs/ChildCat.md deleted file mode 100644 index 513903ac5793..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ChildCat.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChildCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md deleted file mode 100644 index c5b2f58f28ce..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ClassModel.md b/samples/openapi3/client/petstore/python-prior/docs/ClassModel.md deleted file mode 100644 index 6605a16d74a9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ClassModel.md +++ /dev/null @@ -1,13 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Client.md b/samples/openapi3/client/petstore/python-prior/docs/Client.md deleted file mode 100644 index 1b293140f348..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Client.md +++ /dev/null @@ -1,12 +0,0 @@ -# Client - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md deleted file mode 100644 index d9fef9ca283b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md +++ /dev/null @@ -1,13 +0,0 @@ -# ComplexQuadrilateral - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**quadrilateral_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md deleted file mode 100644 index e71647c52247..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md +++ /dev/null @@ -1,15 +0,0 @@ -# ComposedOneOfNumberWithValidations - -this is a model that allows payloads of type object or number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**tail** | **bool** | | [optional] [readonly] if omitted the server will use the default value of True -**class_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md b/samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md deleted file mode 100644 index 5930b762b0c2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md +++ /dev/null @@ -1,13 +0,0 @@ -# ComposedSchemaWithPropsAndNoAddProps - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **str** | | [optional] -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/DanishPig.md b/samples/openapi3/client/petstore/python-prior/docs/DanishPig.md deleted file mode 100644 index 4d1ebe4f68a0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/DanishPig.md +++ /dev/null @@ -1,12 +0,0 @@ -# DanishPig - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md deleted file mode 100644 index 52ae252d4890..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md +++ /dev/null @@ -1,69 +0,0 @@ -# petstore_api.DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | - - -# **foo_get** -> FooGetDefaultResponse foo_get() - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import default_api -from petstore_api.model.foo_get_default_response import FooGetDefaultResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.foo_get() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FooGetDefaultResponse**](FooGetDefaultResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | response | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Dog.md b/samples/openapi3/client/petstore/python-prior/docs/Dog.md deleted file mode 100644 index 7717736c3810..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Dog.md +++ /dev/null @@ -1,16 +0,0 @@ -# Dog - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**breed** | **str** | | [optional] -**legs** | [**Legs**](Legs.md) | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of "red" -**tail** | **bool** | | [optional] [readonly] if omitted the server will use the default value of True -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md deleted file mode 100644 index a12db829f798..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ -# DogAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] -**legs** | [**Legs**](Legs.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Drawing.md b/samples/openapi3/client/petstore/python-prior/docs/Drawing.md deleted file mode 100644 index a4fc4830562f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Drawing.md +++ /dev/null @@ -1,15 +0,0 @@ -# Drawing - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**main_shape** | [**Shape**](Shape.md) | | [optional] -**shape_or_null** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] -**nullable_shape** | [**NullableShape**](NullableShape.md) | | [optional] -**shapes** | [**[Shape]**](Shape.md) | | [optional] -**any string name** | [**Fruit**](Fruit.md) | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md b/samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md deleted file mode 100644 index d578b2836f3e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# EgressThresholdOptions - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**egress_thresholds** | **{str: (float,)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md deleted file mode 100644 index ad4e9d2fcb7c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md +++ /dev/null @@ -1,13 +0,0 @@ -# EnumArrays - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **[str]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/EnumClass.md b/samples/openapi3/client/petstore/python-prior/docs/EnumClass.md deleted file mode 100644 index a1f9aae58190..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/EnumClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/EnumTest.md b/samples/openapi3/client/petstore/python-prior/docs/EnumTest.md deleted file mode 100644 index 988c5ea244dc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/EnumTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# EnumTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string_required** | **str** | | -**enum_string** | **str** | | [optional] -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**enum_bool** | **bool** | | [optional] if omitted the server will use the default value of False -**bool_enum** | [**BooleanEnum**](BooleanEnum.md) | | [optional] -**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] -**integer_enum** | [**IntegerEnum**](IntegerEnum.md) | | [optional] -**string_enum_with_default_value** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] -**integer_enum_with_default_value** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] -**integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] -**inline_array_of_str_enum** | [**[StringEnum]**](StringEnum.md) | | [optional] -**array_of_str_enum** | [**ArrayOfEnums**](ArrayOfEnums.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md deleted file mode 100644 index 2766ad71cefc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md +++ /dev/null @@ -1,13 +0,0 @@ -# EquilateralTriangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**triangle_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FakeApi.md b/samples/openapi3/client/petstore/python-prior/docs/FakeApi.md deleted file mode 100644 index 74beeb930cbd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FakeApi.md +++ /dev/null @@ -1,2141 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums -[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | -[**composed_one_of_number_with_validations**](FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | -[**download_attachment**](FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition -[**enum_test**](FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums -[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal | -[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -[**post_inline_additional_properties_payload**](FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload | -[**post_inline_additional_properties_ref_payload**](FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload | -[**string**](FakeApi.md#string) | **POST** /fake/refs/string | -[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | -[**tx_rx_all_of_model**](FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | -[**tx_rx_any_of_model**](FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | -[**upload_download_file**](FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -[**upload_file**](FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data -[**upload_files**](FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data - - -# **additional_properties_with_array_of_enums** -> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() - -Additional Properties with Array of Enums - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - additional_properties_with_array_of_enums = AdditionalPropertiesWithArrayOfEnums( - key=[ - EnumClass("-efg"), - ], - ) # AdditionalPropertiesWithArrayOfEnums | Input enum (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Additional Properties with Array of Enums - api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums=additional_properties_with_array_of_enums) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **additional_properties_with_array_of_enums** | [**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] - -### Return type - -[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Got object with additional properties with array of enums | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **array_model** -> AnimalFarm array_model() - - - -Test serialization of ArrayModel - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.animal_farm import AnimalFarm -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = AnimalFarm([ - Animal(), - ]) # AnimalFarm | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.array_model(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] - -### Return type - -[**AnimalFarm**](AnimalFarm.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **array_of_enums** -> ArrayOfEnums array_of_enums() - -Array of Enums - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.array_of_enums import ArrayOfEnums -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - array_of_enums = ArrayOfEnums([ - StringEnum("placed"), - ]) # ArrayOfEnums | Input enum (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Array of Enums - api_response = api_instance.array_of_enums(array_of_enums=array_of_enums) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->array_of_enums: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **array_of_enums** | [**ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] - -### Return type - -[**ArrayOfEnums**](ArrayOfEnums.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Got named array of enums | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **boolean** -> bool boolean() - - - -Test serialization of outer boolean types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.boolean(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->boolean: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **composed_one_of_number_with_validations** -> ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() - - - -Test serialization of object with $refed properties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - composed_one_of_number_with_validations = ComposedOneOfNumberWithValidations(None) # ComposedOneOfNumberWithValidations | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations=composed_one_of_number_with_validations) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **composed_one_of_number_with_validations** | [**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] - -### Return type - -[**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **download_attachment** -> file_type download_attachment(file_name) - -downloads a file using Content-Disposition - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - file_name = "fileName_example" # str | file name - - # example passing only required values which don't have defaults set - try: - # downloads a file using Content-Disposition - api_response = api_instance.download_attachment(file_name) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->download_attachment: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_name** | **str**| file name | - -### Return type - -**file_type** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: text/plain - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * Content-Disposition - describes the received file. Looks like: 'attachment; filename=fileName.txt'
| - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **enum_test** -> EnumTest enum_test() - -Object contains enum properties and array properties containing enums - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.enum_test import EnumTest -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - enum_test = EnumTest( - enum_string="UPPER", - enum_string_required="UPPER", - enum_integer=1, - enum_number=1.1, - enum_bool=False, - bool_enum=BooleanEnum(True), - string_enum=StringEnum("placed"), - integer_enum=IntegerEnum(0), - string_enum_with_default_value=StringEnumWithDefaultValue("placed"), - integer_enum_with_default_value=IntegerEnumWithDefaultValue(0), - integer_enum_one_value=IntegerEnumOneValue(0), - inline_array_of_str_enum=[ - StringEnum("placed"), - ], - array_of_str_enum=ArrayOfEnums([ - StringEnum("placed"), - ]), - ) # EnumTest | Input object (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Object contains enum properties and array properties containing enums - api_response = api_instance.enum_test(enum_test=enum_test) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->enum_test: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_test** | [**EnumTest**](EnumTest.md)| Input object | [optional] - -### Return type - -[**EnumTest**](EnumTest.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Got object containing enums | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fake_health_get** -> HealthCheckResult fake_health_get() - -Health check endpoint - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.health_check_result import HealthCheckResult -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **mammal** -> Mammal mammal(mammal) - - - -Test serialization of mammals - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.mammal import Mammal -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - mammal = Mammal(None) # Mammal | Input mammal - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.mammal(mammal) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->mammal: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **mammal** | [**Mammal**](Mammal.md)| Input mammal | - -### Return type - -[**Mammal**](Mammal.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output mammal | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **number_with_validations** -> NumberWithValidations number_with_validations() - - - -Test serialization of outer number types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.number_with_validations import NumberWithValidations -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = NumberWithValidations(10) # NumberWithValidations | Input number as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.number_with_validations(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->number_with_validations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] - -### Return type - -[**NumberWithValidations**](NumberWithValidations.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **object_model_with_ref_props** -> ObjectModelWithRefProps object_model_with_ref_props() - - - -Test serialization of object with $refed properties - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = ObjectModelWithRefProps( - my_number=NumberWithValidations(10), - my_string="my_string_example", - my_boolean=True, - ) # ObjectModelWithRefProps | Input model (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.object_model_with_ref_props(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] - -### Return type - -[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output model | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **post_inline_additional_properties_payload** -> PostInlineAdditionalPropertiesPayloadRequest post_inline_additional_properties_payload() - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner( - labels=[ - "labels_example", - ], - ), - ], - ) # PostInlineAdditionalPropertiesPayloadRequest | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->post_inline_additional_properties_payload: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **post_inline_additional_properties_payload_request** | [**PostInlineAdditionalPropertiesPayloadRequest**](PostInlineAdditionalPropertiesPayloadRequest.md)| | [optional] - -### Return type - -[**PostInlineAdditionalPropertiesPayloadRequest**](PostInlineAdditionalPropertiesPayloadRequest.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | InlineAdditionalPropertiesPayload | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **post_inline_additional_properties_ref_payload** -> InlineAdditionalPropertiesRefPayload post_inline_additional_properties_ref_payload() - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner( - labels=[ - "labels_example", - ], - ), - ], - ) # InlineAdditionalPropertiesRefPayload | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.post_inline_additional_properties_ref_payload(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->post_inline_additional_properties_ref_payload: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **inline_additional_properties_ref_payload** | [**InlineAdditionalPropertiesRefPayload**](InlineAdditionalPropertiesRefPayload.md)| | [optional] - -### Return type - -[**InlineAdditionalPropertiesRefPayload**](InlineAdditionalPropertiesRefPayload.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | InlineAdditionalPropertiesRefPayload | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string** -> str string() - - - -Test serialization of outer string types - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = "body_example" # str | Input string as post body (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **string_enum** -> StringEnum string_enum() - - - -Test serialization of outer enum - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.string_enum import StringEnum -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = StringEnum("placed") # StringEnum | Input enum (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.string_enum(body=body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->string_enum: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] - -### Return type - -[**StringEnum**](StringEnum.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output enum | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - file_schema_test_class = FileSchemaTestClass( - file=File( - source_uri="source_uri_example", - ), - files=[ - File( - source_uri="source_uri_example", - ), - ], - ) # FileSchemaTestClass | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_file_schema(file_schema_test_class) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, user) - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - query = "query_example" # str | - user = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props={}, - object_with_no_declared_props_nullable={}, - any_type_prop=None, - any_type_prop_nullable=None, - ) # User | - - # example passing only required values which don't have defaults set - try: - api_instance.test_body_with_query_params(query, user) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - client = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test \"client\" model - api_response = api_instance.test_client_model(client) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: http_basic_test -configuration = petstore_api.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - number = 32.1 # float | None - double = 67.8 # float | None - pattern_without_delimiter = "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>" # str | None - byte = 'YQ==' # str | None - integer = 10 # int | None (optional) - int32 = 20 # int | None (optional) - int64 = 1 # int | None (optional) - float = 3.14 # float | None (optional) - string = "A" # str | None (optional) - binary = open('/path/to/file', 'rb') # file_type | None (optional) - date = dateutil_parser('1970-01-01').date() # date | None (optional) - date_time = dateutil_parser('2020-02-02T20:20:20.22222Z') # datetime | None (optional) if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') - password = "password_example" # str | None (optional) - param_callback = "param_callback_example" # str | None (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file_type**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters() - -To test enum parameters - -To test enum parameters - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - enum_header_string_array = [ - "$", - ] # [str] | Header parameter enum test (string array) (optional) - enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_string_array = [ - "$", - ] # [str] | Query parameter enum test (string array) (optional) - enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - enum_query_integer = 1 # int | Query parameter enum test (double) (optional) - enum_query_double = 1.1 # float | Query parameter enum test (double) (optional) - enum_form_string_array = [ - "$", - ] # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of "$" - enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of "-efg" - - # example passing only required values which don't have defaults set - # and optional values - try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of "$" - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -* Bearer (JWT) Authentication (bearer_test): - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization (JWT): bearer_test -configuration = petstore_api.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - required_string_group = 1 # int | Required String in group parameters - required_boolean_group = True # bool | Required Boolean in group parameters - required_int64_group = 1 # int | Required Integer in group parameters - string_group = 1 # int | String in group parameters (optional) - boolean_group = True # bool | Boolean in group parameters (optional) - int64_group = 1 # int | Integer in group parameters (optional) - - # example passing only required values which don't have defaults set - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Something wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(request_body) - -test inline additionalProperties - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - request_body = { - "key": "key_example", - } # {str: (str,)} | request body - - # example passing only required values which don't have defaults set - try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | **{str: (str,)}**| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - param = "param_example" # str | field1 - param2 = "param2_example" # str | field2 - - # example passing only required values which don't have defaults set - try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - pipe = [ - "pipe_example", - ] # [str] | - ioutil = [ - "ioutil_example", - ] # [str] | - http = [ - "http_example", - ] # [str] | - url = [ - "url_example", - ] # [str] | - context = [ - "context_example", - ] # [str] | - - # example passing only required values which don't have defaults set - try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | **[str]**| | - **ioutil** | **[str]**| | - **http** | **[str]**| | - **url** | **[str]**| | - **context** | **[str]**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tx_rx_all_of_model** -> StreamOptions tx_rx_all_of_model() - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.stream_options import StreamOptions -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - stream_options = StreamOptions(None) # StreamOptions | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.tx_rx_all_of_model(stream_options=stream_options) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->tx_rx_all_of_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **stream_options** | [**StreamOptions**](StreamOptions.md)| | [optional] - -### Return type - -[**StreamOptions**](StreamOptions.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tx_rx_any_of_model** -> GmFruitNoProperties tx_rx_any_of_model() - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - gm_fruit_no_properties = GmFruitNoProperties(None) # GmFruitNoProperties | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.tx_rx_any_of_model(gm_fruit_no_properties=gm_fruit_no_properties) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->tx_rx_any_of_model: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gm_fruit_no_properties** | [**GmFruitNoProperties**](GmFruitNoProperties.md)| | [optional] - -### Return type - -[**GmFruitNoProperties**](GmFruitNoProperties.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | TxRxAnyOfModel | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_download_file** -> file_type upload_download_file(body) - -uploads a file and downloads a file using application/octet-stream - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - body = open('/path/to/file', 'rb') # file_type | - - # example passing only required values which don't have defaults set - try: - # uploads a file and downloads a file using application/octet-stream - api_response = api_instance.upload_download_file(body) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_download_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **file_type**| | - -### Return type - -**file_type** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/octet-stream - - **Accept**: application/octet-stream - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_file** -> ApiResponse upload_file(file) - -uploads a file using multipart/form-data - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - file = open('/path/to/file', 'rb') # file_type | file to upload - additional_metadata = "additional_metadata_example" # str | Additional data to pass to server (optional) - - # example passing only required values which don't have defaults set - try: - # uploads a file using multipart/form-data - api_response = api_instance.upload_file(file) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads a file using multipart/form-data - api_response = api_instance.upload_file(file, additional_metadata=additional_metadata) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file** | **file_type**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **upload_files** -> ApiResponse upload_files() - -uploads files using multipart/form-data - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import fake_api -from petstore_api.model.api_response import ApiResponse -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = fake_api.FakeApi(api_client) - files = [ - open('/path/to/file', 'rb'), - ] # [file_type] | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # uploads files using multipart/form-data - api_response = api_instance.upload_files(files=files) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeApi->upload_files: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **files** | **[file_type]**| | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 57b52cf8fdad..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,89 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): - -```python -import time -import petstore_api -from petstore_api.api import fake_classname_tags123_api -from petstore_api.model.client import Client -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) - client = Client( - client="client_example", - ) # Client | client model - - # example passing only required values which don't have defaults set - try: - # To test class name in snake case - api_response = api_instance.test_classname(client) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md b/samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md deleted file mode 100644 index 23ec35f5dcd3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md +++ /dev/null @@ -1,12 +0,0 @@ -# FakePostInlineAdditionalPropertiesPayloadArrayData - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labels** | **[str, none_type]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/File.md b/samples/openapi3/client/petstore/python-prior/docs/File.md deleted file mode 100644 index f84547d19331..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/File.md +++ /dev/null @@ -1,13 +0,0 @@ -# File - -Must be named `File` for test. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md deleted file mode 100644 index 4572aa0905b3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileSchemaTestClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**[File]**](File.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Foo.md b/samples/openapi3/client/petstore/python-prior/docs/Foo.md deleted file mode 100644 index c9c54d1ee40a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Foo.md +++ /dev/null @@ -1,12 +0,0 @@ -# Foo - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] if omitted the server will use the default value of "bar" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md deleted file mode 100644 index c89067a5d31f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# FooGetDefaultResponse - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FooObject.md b/samples/openapi3/client/petstore/python-prior/docs/FooObject.md deleted file mode 100644 index 55a7fc671efc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FooObject.md +++ /dev/null @@ -1,13 +0,0 @@ -# FooObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**prop1** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** | | [optional] -**prop2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FormatTest.md b/samples/openapi3/client/petstore/python-prior/docs/FormatTest.md deleted file mode 100644 index 3c8cc8697c1c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FormatTest.md +++ /dev/null @@ -1,27 +0,0 @@ -# FormatTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | | -**byte** | **str** | | -**date** | **date** | | -**password** | **str** | | -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**binary** | **file_type** | | [optional] -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**uuid_no_example** | **str** | | [optional] -**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Fruit.md b/samples/openapi3/client/petstore/python-prior/docs/Fruit.md deleted file mode 100644 index d65f4cb14b4f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Fruit.md +++ /dev/null @@ -1,16 +0,0 @@ -# Fruit - -a schema that tests oneOf and includes a schema level property - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cultivar** | **str** | | -**length_cm** | **float** | | -**color** | **str** | | [optional] -**origin** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/FruitReq.md b/samples/openapi3/client/petstore/python-prior/docs/FruitReq.md deleted file mode 100644 index 086a82233533..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/FruitReq.md +++ /dev/null @@ -1,16 +0,0 @@ -# FruitReq - -a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas also, this scheme accepts null as a value - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mealy** | **bool** | | [optional] -**sweet** | **bool** | | [optional] -**cultivar** | **str** | | [optional] -**length_cm** | **float** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/GmFruit.md b/samples/openapi3/client/petstore/python-prior/docs/GmFruit.md deleted file mode 100644 index 4da4dd53ad44..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/GmFruit.md +++ /dev/null @@ -1,15 +0,0 @@ -# GmFruit - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cultivar** | **str** | | -**length_cm** | **float** | | -**color** | **str** | | [optional] -**origin** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md b/samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md deleted file mode 100644 index ca206a83ced7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md +++ /dev/null @@ -1,14 +0,0 @@ -# GmFruitNoProperties - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**origin** | **str** | | [optional] -**cultivar** | **str** | | [optional] -**length_cm** | **float** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md deleted file mode 100644 index a1c340378106..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md +++ /dev/null @@ -1,12 +0,0 @@ -# GrandparentAnimal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md deleted file mode 100644 index 88bc03d4ff5c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,13 +0,0 @@ -# HasOnlyReadOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md deleted file mode 100644 index e20455fb377a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md +++ /dev/null @@ -1,13 +0,0 @@ -# HealthCheckResult - -Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullable_message** | **str, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md b/samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md deleted file mode 100644 index 4f97b3de37ef..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineAdditionalPropertiesRefPayload - -this payload is used for verification that some model_to_dict issues are fixed - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_data** | [**[PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type**](PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject.md deleted file mode 100644 index f567ea188ce0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Updated name of the pet | [optional] -**status** | **str** | Updated status of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md deleted file mode 100644 index 4349ad73e3b7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **str** | Additional data to pass to server | [optional] -**file** | **file_type** | file to upload | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md deleted file mode 100644 index 9312bc7e3a19..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md deleted file mode 100644 index 34d5eb478457..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md +++ /dev/null @@ -1,23 +0,0 @@ -# InlineObject3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | None | -**double** | **float** | None | -**pattern_without_delimiter** | **str** | None | -**byte** | **str** | None | -**integer** | **int** | None | [optional] -**int32** | **int** | None | [optional] -**int64** | **int** | None | [optional] -**float** | **float** | None | [optional] -**string** | **str** | None | [optional] -**binary** | **file_type** | None | [optional] -**date** | **date** | None | [optional] -**date_time** | **datetime** | None | [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') -**password** | **str** | None | [optional] -**callback** | **str** | None | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md deleted file mode 100644 index 07574d0d0769..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject4 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **str** | field1 | -**param2** | **str** | field2 | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md deleted file mode 100644 index 8f8662c434db..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**required_file** | **file_type** | file to upload | -**additional_metadata** | **str** | Additional data to pass to server | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md deleted file mode 100644 index b4a7a55a2c7f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineObject6 - -this payload is used for verification that some model_to_dict issues are fixed - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md b/samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md deleted file mode 100644 index 659957b26ddc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineResponse200 - -this payload is used for verification that some model_to_dict issues are fixed - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md deleted file mode 100644 index b8823d383bac..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md +++ /dev/null @@ -1,12 +0,0 @@ -# InlineResponseDefault - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md deleted file mode 100644 index 9567a76cc2e2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# IntegerEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | must be one of [0, 1, 2, ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md deleted file mode 100644 index 99dcaa7a4ec3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md +++ /dev/null @@ -1,11 +0,0 @@ -# IntegerEnumOneValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | defaults to 0, must be one of [0, ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md deleted file mode 100644 index 4b8e39d9cadd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md +++ /dev/null @@ -1,11 +0,0 @@ -# IntegerEnumWithDefaultValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | defaults to 0, must be one of [0, 1, 2, ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md deleted file mode 100644 index 57cfa6d12ad1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md +++ /dev/null @@ -1,13 +0,0 @@ -# IsoscelesTriangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**triangle_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Legs.md b/samples/openapi3/client/petstore/python-prior/docs/Legs.md deleted file mode 100644 index e9faeb08adce..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Legs.md +++ /dev/null @@ -1,13 +0,0 @@ -# Legs - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**legs** | **str** | | defaults to "4" -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/List.md b/samples/openapi3/client/petstore/python-prior/docs/List.md deleted file mode 100644 index 13f2694de358..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/List.md +++ /dev/null @@ -1,12 +0,0 @@ -# List - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Mammal.md b/samples/openapi3/client/petstore/python-prior/docs/Mammal.md deleted file mode 100644 index 4d9d8cc52040..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Mammal.md +++ /dev/null @@ -1,15 +0,0 @@ -# Mammal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**has_baleen** | **bool** | | [optional] -**has_teeth** | **bool** | | [optional] -**type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/MapTest.md b/samples/openapi3/client/petstore/python-prior/docs/MapTest.md deleted file mode 100644 index e6584f3811e0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/MapTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# MapTest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_of_enum_string** | **{str: (str,)}** | | [optional] -**direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f32c4e04134b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Model200Response.md b/samples/openapi3/client/petstore/python-prior/docs/Model200Response.md deleted file mode 100644 index f7ef7d79acf6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Model200Response.md +++ /dev/null @@ -1,14 +0,0 @@ -# Model200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md deleted file mode 100644 index 75fb39a88698..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md +++ /dev/null @@ -1,13 +0,0 @@ -# ModelReturn - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md b/samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md deleted file mode 100644 index 3d5777b2b108..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md +++ /dev/null @@ -1,14 +0,0 @@ -# Model_200Response - -Model for testing model name starting with number - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Model_Return.md b/samples/openapi3/client/petstore/python-prior/docs/Model_Return.md deleted file mode 100644 index d9c1a2d8119b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Model_Return.md +++ /dev/null @@ -1,13 +0,0 @@ -# Model_Return - -Model for testing reserved words - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Mole.md b/samples/openapi3/client/petstore/python-prior/docs/Mole.md deleted file mode 100644 index 6c4f714963e2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Mole.md +++ /dev/null @@ -1,17 +0,0 @@ -# Mole - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**blind** | **bool** | | [readonly] -**smell** | **str** | | -**hearing** | **bool** | | -**touch** | **bool** | | [optional] [readonly] -**taste** | **str** | | [optional] -**seeing_ghosts** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Name.md b/samples/openapi3/client/petstore/python-prior/docs/Name.md deleted file mode 100644 index 6e58fae6d0bb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Name.md +++ /dev/null @@ -1,16 +0,0 @@ -# Name - -Model for testing model name same as property name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/NullableClass.md b/samples/openapi3/client/petstore/python-prior/docs/NullableClass.md deleted file mode 100644 index 48a27469f6c9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/NullableClass.md +++ /dev/null @@ -1,24 +0,0 @@ -# NullableClass - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer_prop** | **int, none_type** | | [optional] -**number_prop** | **float, none_type** | | [optional] -**boolean_prop** | **bool, none_type** | | [optional] -**string_prop** | **str, none_type** | | [optional] -**date_prop** | **date, none_type** | | [optional] -**datetime_prop** | **datetime, none_type** | | [optional] -**array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional] -**array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional] -**array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional] -**object_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] -**object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional] -**object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional] -**object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/NullableShape.md b/samples/openapi3/client/petstore/python-prior/docs/NullableShape.md deleted file mode 100644 index a1c658a39346..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/NullableShape.md +++ /dev/null @@ -1,15 +0,0 @@ -# NullableShape - -The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**quadrilateral_type** | **str** | | [optional] -**triangle_type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md deleted file mode 100644 index 172e86163a44..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# NumberOnly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md deleted file mode 100644 index 119e0f678239..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberWithValidations - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md deleted file mode 100644 index ee5bc32898be..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md +++ /dev/null @@ -1,11 +0,0 @@ -# ObjectInterface - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md deleted file mode 100644 index 60fe997afa05..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md +++ /dev/null @@ -1,16 +0,0 @@ -# ObjectModelWithRefProps - -a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] -**my_readonly** | [**Readonly**](Readonly.md) | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md deleted file mode 100644 index 9d3e2de12a1c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md +++ /dev/null @@ -1,11 +0,0 @@ -# ObjectWithValidations - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Order.md b/samples/openapi3/client/petstore/python-prior/docs/Order.md deleted file mode 100644 index 0423082932d5..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Order.md +++ /dev/null @@ -1,17 +0,0 @@ -# Order - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] if omitted the server will use the default value of False -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ParentPet.md b/samples/openapi3/client/petstore/python-prior/docs/ParentPet.md deleted file mode 100644 index 111ada88b3d1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ParentPet.md +++ /dev/null @@ -1,12 +0,0 @@ -# ParentPet - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pet_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Pet.md b/samples/openapi3/client/petstore/python-prior/docs/Pet.md deleted file mode 100644 index bb6e8d344e64..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Pet.md +++ /dev/null @@ -1,18 +0,0 @@ -# Pet - -Pet object that needs to be added to the store - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**photo_urls** | **[str]** | | -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/PetApi.md b/samples/openapi3/client/petstore/python-prior/docs/PetApi.md deleted file mode 100644 index f1ce099c8bea..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/PetApi.md +++ /dev/null @@ -1,859 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data - - -# **add_pet** -> add_pet(pet) - -Add a new pet to the store - - - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Add a new pet to the store - api_instance.add_pet(pet) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_pet** -> delete_pet(pet_id) - -Deletes a pet - - - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | Pet id to delete - api_key = "api_key_example" # str | (optional) - - # example passing only required values which don't have defaults set - try: - # Deletes a pet - api_instance.delete_pet(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid pet value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_status** -> [Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - status = [ - "available", - ] # [str] | Status values that need to be considered for filter - - # example passing only required values which don't have defaults set - try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **[str]**| Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **find_pets_by_tags** -> [Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - tags = ["tag1","tag2"] # [str] | Tags to filter by - - # example passing only required values which don't have defaults set - try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | **[str]**| Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet to return - - # example passing only required values which don't have defaults set - try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet** -> update_pet(pet) - -Update an existing pet - - - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model.pet import Pet -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Configure HTTP message signature: http_signature_test -# The HTTP Signature Header mechanism that can be used by a client to -# authenticate the sender of a message and ensure that particular headers -# have not been modified in transit. -# -# You can specify the signing key-id, private key path, signing scheme, -# signing algorithm, list of signed headers and signature max validity. -# The 'key_id' parameter is an opaque string that the API server can use -# to lookup the client and validate the signature. -# The 'private_key_path' parameter should be the path to a file that -# contains a DER or base-64 encoded private key. -# The 'private_key_passphrase' parameter is optional. Set the passphrase -# if the private key is encrypted. -# The 'signed_headers' parameter is used to specify the list of -# HTTP headers included when generating the signature for the message. -# You can specify HTTP headers that you want to protect with a cryptographic -# signature. Note that proxies may add, modify or remove HTTP headers -# for legitimate reasons, so you should only add headers that you know -# will not be modified. For example, if you want to protect the HTTP request -# body, you can specify the Digest header. In that case, the client calculates -# the digest of the HTTP request body and includes the digest in the message -# signature. -# The 'signature_max_validity' parameter is optional. It is configured as a -# duration to express when the signature ceases to be valid. The client calculates -# the expiration date every time it generates the cryptographic signature -# of an HTTP request. The API server may have its own security policy -# that controls the maximum validity of the signature. The client max validity -# must be lower than the server max validity. -# The time on the client and server must be synchronized, otherwise the -# server may reject the client signature. -# -# The client must use a combination of private key, signing scheme, -# signing algorithm and hash algorithm that matches the security policy of -# the API server. -# -# See petstore_api.signing for a list of all supported parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2", - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'private_key.pem', - private_key_passphrase = 'YOUR_PASSPHRASE', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, - signed_headers = [ - petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet = Pet( - id=1, - category=Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ - "photo_urls_example", - ], - tags=[ - Tag( - id=1, - name="name_example", - ), - ], - status="available", - ) # Pet | Pet object that needs to be added to the store - - # example passing only required values which don't have defaults set - try: - # Update an existing pet - api_instance.update_pet(pet) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_pet_with_form** -> update_pet_with_form(pet_id) - -Updates a pet in the store with form data - - - -### Example - -* OAuth Authentication (petstore_auth): - -```python -import time -import petstore_api -from petstore_api.api import pet_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure OAuth2 access token for authorization: petstore_auth -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = pet_api.PetApi(api_client) - pet_id = 1 # int | ID of pet that needs to be updated - name = "name_example" # str | Updated name of the pet (optional) - status = "status_example" # str | Updated status of the pet (optional) - - # example passing only required values which don't have defaults set - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) - except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Pig.md b/samples/openapi3/client/petstore/python-prior/docs/Pig.md deleted file mode 100644 index 30b4d17f60ce..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Pig.md +++ /dev/null @@ -1,12 +0,0 @@ -# Pig - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md b/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md deleted file mode 100644 index 096ff6a1827e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# PostInlineAdditionalPropertiesPayloadRequest - -this payload is used for verification that some model_to_dict issues are fixed - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_data** | [**[PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type**](PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md b/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md deleted file mode 100644 index 4b093ce6de61..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md +++ /dev/null @@ -1,12 +0,0 @@ -# PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labels** | **[str, none_type]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md b/samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md deleted file mode 100644 index 2f654b33683b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# PublishOptions - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**publish** | [**PublishOptionsPublish**](PublishOptionsPublish.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md b/samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md deleted file mode 100644 index 016c2745dff2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md +++ /dev/null @@ -1,13 +0,0 @@ -# PublishOptionsPublish - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**egress_unknown_detections** | **bool** | | [optional] -**filter_zero_detections** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md deleted file mode 100644 index 7418ca26b451..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md +++ /dev/null @@ -1,13 +0,0 @@ -# Quadrilateral - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**quadrilateral_type** | **str** | | -**shape_type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md deleted file mode 100644 index 05573544bd79..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuadrilateralInterface - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**quadrilateral_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md deleted file mode 100644 index ba39ec3d04e4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,13 +0,0 @@ -# ReadOnlyFirst - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Readonly.md b/samples/openapi3/client/petstore/python-prior/docs/Readonly.md deleted file mode 100644 index e94598c9d388..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Readonly.md +++ /dev/null @@ -1,12 +0,0 @@ -# Readonly - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md deleted file mode 100644 index 0910a264c00a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md +++ /dev/null @@ -1,13 +0,0 @@ -# ScaleneTriangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**triangle_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Shape.md b/samples/openapi3/client/petstore/python-prior/docs/Shape.md deleted file mode 100644 index fe458b1df03a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Shape.md +++ /dev/null @@ -1,14 +0,0 @@ -# Shape - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**quadrilateral_type** | **str** | | [optional] -**triangle_type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md deleted file mode 100644 index 012d4a0cdd86..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md +++ /dev/null @@ -1,12 +0,0 @@ -# ShapeInterface - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md deleted file mode 100644 index ee3fbbdcb25b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md +++ /dev/null @@ -1,15 +0,0 @@ -# ShapeOrNull - -The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**quadrilateral_type** | **str** | | [optional] -**triangle_type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md deleted file mode 100644 index 13672f48c961..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md +++ /dev/null @@ -1,13 +0,0 @@ -# SimpleQuadrilateral - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shape_type** | **str** | | -**quadrilateral_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/SomeObject.md b/samples/openapi3/client/petstore/python-prior/docs/SomeObject.md deleted file mode 100644 index 8b3723863e52..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/SomeObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# SomeObject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md b/samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md deleted file mode 100644 index 6704f480eb3b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md +++ /dev/null @@ -1,12 +0,0 @@ -# SomeObjectWithSelfAttr - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_self** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md deleted file mode 100644 index 4a1c86ff4de0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md +++ /dev/null @@ -1,12 +0,0 @@ -# SpecialModelName - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/StoreApi.md b/samples/openapi3/client/petstore/python-prior/docs/StoreApi.md deleted file mode 100644 index 1abbf51ab6b9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/StoreApi.md +++ /dev/null @@ -1,295 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = "order_id_example" # str | ID of the order that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete purchase order by ID - api_instance.delete_order(order_id) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_inventory** -> {str: (int,)} get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): - -```python -import time -import petstore_api -from petstore_api.api import store_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with petstore_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (int,)}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order_id = 1 # int | ID of pet that needs to be fetched - - # example passing only required values which don't have defaults set - try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **place_order** -> Order place_order(order) - -Place an order for a pet - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import store_api -from petstore_api.model.order import Order -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = store_api.StoreApi(api_client) - order = Order( - id=1, - pet_id=1, - quantity=1, - ship_date=dateutil_parser('2020-02-02T20:20:20.000222Z'), - status="placed", - complete=False, - ) # Order | order placed for purchasing the pet - - # example passing only required values which don't have defaults set - try: - # Place an order for a pet - api_response = api_instance.place_order(order) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md b/samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md deleted file mode 100644 index 4bb016c450e3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md +++ /dev/null @@ -1,13 +0,0 @@ -# StreamOptions - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**egress_thresholds** | **{str: (float,)}** | | [optional] -**publish** | [**PublishOptionsPublish**](PublishOptionsPublish.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md deleted file mode 100644 index 217c79704081..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringBooleanMap - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/StringEnum.md b/samples/openapi3/client/petstore/python-prior/docs/StringEnum.md deleted file mode 100644 index b03f3b1e6c64..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/StringEnum.md +++ /dev/null @@ -1,13 +0,0 @@ -# StringEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md deleted file mode 100644 index 7799b93d8223..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md +++ /dev/null @@ -1,11 +0,0 @@ -# StringEnumWithDefaultValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to "placed", must be one of ["placed", "approved", "delivered", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Tag.md b/samples/openapi3/client/petstore/python-prior/docs/Tag.md deleted file mode 100644 index 8a95090c036d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Tag.md +++ /dev/null @@ -1,13 +0,0 @@ -# Tag - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Triangle.md b/samples/openapi3/client/petstore/python-prior/docs/Triangle.md deleted file mode 100644 index 85e1d6bb437d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Triangle.md +++ /dev/null @@ -1,13 +0,0 @@ -# Triangle - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**triangle_type** | **str** | | -**shape_type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md deleted file mode 100644 index 9f8411eabdf2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md +++ /dev/null @@ -1,12 +0,0 @@ -# TriangleInterface - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**triangle_type** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/User.md b/samples/openapi3/client/petstore/python-prior/docs/User.md deleted file mode 100644 index 4d2da357adb1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/User.md +++ /dev/null @@ -1,23 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] -**object_with_no_declared_props** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] -**object_with_no_declared_props_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] -**any_type_prop** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] -**any_type_prop_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/UserApi.md b/samples/openapi3/client/petstore/python-prior/docs/UserApi.md deleted file mode 100644 index a2e2325092c0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/UserApi.md +++ /dev/null @@ -1,604 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - user = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props={}, - object_with_no_declared_props_nullable={}, - any_type_prop=None, - any_type_prop_nullable=None, - ) # User | Created user object - - # example passing only required values which don't have defaults set - try: - # Create user - api_instance.create_user(user) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_array_input** -> create_users_with_array_input(user) - -Creates list of users with given input array - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - user = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props={}, - object_with_no_declared_props_nullable={}, - any_type_prop=None, - any_type_prop_nullable=None, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(user) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_users_with_list_input** -> create_users_with_list_input(user) - -Creates list of users with given input array - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - user = [ - User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props={}, - object_with_no_declared_props_nullable={}, - any_type_prop=None, - any_type_prop_nullable=None, - ), - ] # [User] | List of user object - - # example passing only required values which don't have defaults set - try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(user) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be deleted - - # example passing only required values which don't have defaults set - try: - # Delete user - api_instance.delete_user(username) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The name that needs to be fetched. Use user1 for testing. - - # example passing only required values which don't have defaults set - try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | The user name for login - password = "password_example" # str | The password for login in clear text - - # example passing only required values which don't have defaults set - try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - - - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Logs out current logged in user session - api_instance.logout_user() - except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_user** -> update_user(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example - - -```python -import time -import petstore_api -from petstore_api.api import user_api -from petstore_api.model.user import User -from pprint import pprint -# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = petstore_api.Configuration( - host = "http://petstore.swagger.io:80/v2" -) - - -# Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: - # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - username = "username_example" # str | name that need to be deleted - user = User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props={}, - object_with_no_declared_props_nullable={}, - any_type_prop=None, - any_type_prop_nullable=None, - ) # User | Updated user object - - # example passing only required values which don't have defaults set - try: - # Updated user - api_instance.update_user(username, user) - except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Whale.md b/samples/openapi3/client/petstore/python-prior/docs/Whale.md deleted file mode 100644 index 500786012ead..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Whale.md +++ /dev/null @@ -1,14 +0,0 @@ -# Whale - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**has_baleen** | **bool** | | [optional] -**has_teeth** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/docs/Zebra.md b/samples/openapi3/client/petstore/python-prior/docs/Zebra.md deleted file mode 100644 index 980d8d98e904..000000000000 --- a/samples/openapi3/client/petstore/python-prior/docs/Zebra.md +++ /dev/null @@ -1,13 +0,0 @@ -# Zebra - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**type** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-prior/git_push.sh b/samples/openapi3/client/petstore/python-prior/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/openapi3/client/petstore/python-prior/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py deleted file mode 100644 index e79f5c78b220..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# flake8: noqa - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from petstore_api.api_client import ApiClient - -# import Configuration -from petstore_api.configuration import Configuration -from petstore_api.signing import HttpSigningConfiguration - -# import exceptions -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiAttributeError -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException - -__import__('sys').setrecursionlimit(1234) diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py deleted file mode 100644 index 840e9f0cd908..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from petstore_api.apis import AnotherFakeApi diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py deleted file mode 100644 index 9945fc1ee9b7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,171 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/another-fake/dummy', - 'operation_id': 'call_123_test_special_tags', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def call_123_test_special_tags( - self, - client, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['client'] = \ - client - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py deleted file mode 100644 index 861b95fab498..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py +++ /dev/null @@ -1,157 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.foo_get_default_response import FooGetDefaultResponse - - -class DefaultApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.foo_get_endpoint = _Endpoint( - settings={ - 'response_type': (FooGetDefaultResponse,), - 'auth': [], - 'endpoint_path': '/foo', - 'operation_id': 'foo_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - - def foo_get( - self, - **kwargs - ): - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.foo_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FooGetDefaultResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.foo_get_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py deleted file mode 100644 index a8e94f10e5b4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py +++ /dev/null @@ -1,4134 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.array_of_enums import ArrayOfEnums -from petstore_api.model.client import Client -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties -from petstore_api.model.health_check_result import HealthCheckResult -from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload -from petstore_api.model.mammal import Mammal -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest -from petstore_api.model.stream_options import StreamOptions -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.user import User - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.additional_properties_with_array_of_enums_endpoint = _Endpoint( - settings={ - 'response_type': (AdditionalPropertiesWithArrayOfEnums,), - 'auth': [], - 'endpoint_path': '/fake/additional-properties-with-array-of-enums', - 'operation_id': 'additional_properties_with_array_of_enums', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'additional_properties_with_array_of_enums', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'additional_properties_with_array_of_enums': - (AdditionalPropertiesWithArrayOfEnums,), - }, - 'attribute_map': { - }, - 'location_map': { - 'additional_properties_with_array_of_enums': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.array_model_endpoint = _Endpoint( - settings={ - 'response_type': (AnimalFarm,), - 'auth': [], - 'endpoint_path': '/fake/refs/arraymodel', - 'operation_id': 'array_model', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (AnimalFarm,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.array_of_enums_endpoint = _Endpoint( - settings={ - 'response_type': (ArrayOfEnums,), - 'auth': [], - 'endpoint_path': '/fake/refs/array-of-enums', - 'operation_id': 'array_of_enums', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'array_of_enums', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'array_of_enums': - (ArrayOfEnums,), - }, - 'attribute_map': { - }, - 'location_map': { - 'array_of_enums': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.boolean_endpoint = _Endpoint( - settings={ - 'response_type': (bool,), - 'auth': [], - 'endpoint_path': '/fake/refs/boolean', - 'operation_id': 'boolean', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (bool,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.composed_one_of_number_with_validations_endpoint = _Endpoint( - settings={ - 'response_type': (ComposedOneOfNumberWithValidations,), - 'auth': [], - 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations', - 'operation_id': 'composed_one_of_number_with_validations', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'composed_one_of_number_with_validations', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'composed_one_of_number_with_validations': - (ComposedOneOfNumberWithValidations,), - }, - 'attribute_map': { - }, - 'location_map': { - 'composed_one_of_number_with_validations': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.download_attachment_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [], - 'endpoint_path': '/{fileName}', - 'operation_id': 'download_attachment', - 'http_method': 'GET', - 'servers': [ - { - 'url': "http://www.jtricks.com", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'file_name', - ], - 'required': [ - 'file_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'file_name': - (str,), - }, - 'attribute_map': { - 'file_name': 'fileName', - }, - 'location_map': { - 'file_name': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.enum_test_endpoint = _Endpoint( - settings={ - 'response_type': (EnumTest,), - 'auth': [], - 'endpoint_path': '/fake/refs/enum-test', - 'operation_id': 'enum_test', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'enum_test', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'enum_test': - (EnumTest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'enum_test': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.fake_health_get_endpoint = _Endpoint( - settings={ - 'response_type': (HealthCheckResult,), - 'auth': [], - 'endpoint_path': '/fake/health', - 'operation_id': 'fake_health_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.mammal_endpoint = _Endpoint( - settings={ - 'response_type': (Mammal,), - 'auth': [], - 'endpoint_path': '/fake/refs/mammal', - 'operation_id': 'mammal', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'mammal', - ], - 'required': [ - 'mammal', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'mammal': - (Mammal,), - }, - 'attribute_map': { - }, - 'location_map': { - 'mammal': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.number_with_validations_endpoint = _Endpoint( - settings={ - 'response_type': (NumberWithValidations,), - 'auth': [], - 'endpoint_path': '/fake/refs/number', - 'operation_id': 'number_with_validations', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (NumberWithValidations,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.object_model_with_ref_props_endpoint = _Endpoint( - settings={ - 'response_type': (ObjectModelWithRefProps,), - 'auth': [], - 'endpoint_path': '/fake/refs/object_model_with_ref_props', - 'operation_id': 'object_model_with_ref_props', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (ObjectModelWithRefProps,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.post_inline_additional_properties_payload_endpoint = _Endpoint( - settings={ - 'response_type': (PostInlineAdditionalPropertiesPayloadRequest,), - 'auth': [], - 'endpoint_path': '/fake/postInlineAdditionalPropertiesPayload', - 'operation_id': 'post_inline_additional_properties_payload', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'post_inline_additional_properties_payload_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'post_inline_additional_properties_payload_request': - (PostInlineAdditionalPropertiesPayloadRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'post_inline_additional_properties_payload_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.post_inline_additional_properties_ref_payload_endpoint = _Endpoint( - settings={ - 'response_type': (InlineAdditionalPropertiesRefPayload,), - 'auth': [], - 'endpoint_path': '/fake/postInlineAdditionalPropertiesRefPayload', - 'operation_id': 'post_inline_additional_properties_ref_payload', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'inline_additional_properties_ref_payload', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'inline_additional_properties_ref_payload': - (InlineAdditionalPropertiesRefPayload,), - }, - 'attribute_map': { - }, - 'location_map': { - 'inline_additional_properties_ref_payload': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.string_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/fake/refs/string', - 'operation_id': 'string', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (str,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.string_enum_endpoint = _Endpoint( - settings={ - 'response_type': (StringEnum,), - 'auth': [], - 'endpoint_path': '/fake/refs/enum', - 'operation_id': 'string_enum', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - 'body', - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (StringEnum,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_body_with_file_schema_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-file-schema', - 'operation_id': 'test_body_with_file_schema', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'file_schema_test_class', - ], - 'required': [ - 'file_schema_test_class', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'file_schema_test_class': - (FileSchemaTestClass,), - }, - 'attribute_map': { - }, - 'location_map': { - 'file_schema_test_class': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_body_with_query_params_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-query-params', - 'operation_id': 'test_body_with_query_params', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'query', - 'user', - ], - 'required': [ - 'query', - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'query': - (str,), - 'user': - (User,), - }, - 'attribute_map': { - 'query': 'query', - }, - 'location_map': { - 'query': 'query', - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_client_model_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_client_model', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_endpoint_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'http_basic_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_endpoint_parameters', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback', - ], - 'required': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'integer', - 'int32', - 'float', - 'string', - 'password', - ] - }, - root_map={ - 'validations': { - ('number',): { - - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('double',): { - - 'exclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('pattern_without_delimiter',): { - - 'regex': { - 'pattern': r'^[A-Z].*', # noqa: E501 - }, - }, - ('integer',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - - 'exclusive_maximum': 987.6, - }, - ('string',): { - - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'number': - (float,), - 'double': - (float,), - 'pattern_without_delimiter': - (str,), - 'byte': - (str,), - 'integer': - (int,), - 'int32': - (int,), - 'int64': - (int,), - 'float': - (float,), - 'string': - (str,), - 'binary': - (file_type,), - 'date': - (date,), - 'date_time': - (datetime,), - 'password': - (str,), - 'param_callback': - (str,), - }, - 'attribute_map': { - 'number': 'number', - 'double': 'double', - 'pattern_without_delimiter': 'pattern_without_delimiter', - 'byte': 'byte', - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'float': 'float', - 'string': 'string', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'password': 'password', - 'param_callback': 'callback', - }, - 'location_map': { - 'number': 'form', - 'double': 'form', - 'pattern_without_delimiter': 'form', - 'byte': 'form', - 'integer': 'form', - 'int32': 'form', - 'int64': 'form', - 'float': 'form', - 'string': 'form', - 'binary': 'form', - 'date': 'form', - 'date_time': 'form', - 'password': 'form', - 'param_callback': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_enum_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_enum_parameters', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('enum_header_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_header_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_query_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_integer',): { - - "1": 1, - "-2": -2 - }, - ('enum_query_double',): { - - "1.1": 1.1, - "-1.2": -1.2 - }, - ('enum_form_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_form_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - }, - 'openapi_types': { - 'enum_header_string_array': - ([str],), - 'enum_header_string': - (str,), - 'enum_query_string_array': - ([str],), - 'enum_query_string': - (str,), - 'enum_query_integer': - (int,), - 'enum_query_double': - (float,), - 'enum_form_string_array': - ([str],), - 'enum_form_string': - (str,), - }, - 'attribute_map': { - 'enum_header_string_array': 'enum_header_string_array', - 'enum_header_string': 'enum_header_string', - 'enum_query_string_array': 'enum_query_string_array', - 'enum_query_string': 'enum_query_string', - 'enum_query_integer': 'enum_query_integer', - 'enum_query_double': 'enum_query_double', - 'enum_form_string_array': 'enum_form_string_array', - 'enum_form_string': 'enum_form_string', - }, - 'location_map': { - 'enum_header_string_array': 'header', - 'enum_header_string': 'header', - 'enum_query_string_array': 'query', - 'enum_query_string': 'query', - 'enum_query_integer': 'query', - 'enum_query_double': 'query', - 'enum_form_string_array': 'form', - 'enum_form_string': 'form', - }, - 'collection_format_map': { - 'enum_header_string_array': 'csv', - 'enum_query_string_array': 'multi', - 'enum_form_string_array': 'csv', - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_group_parameters_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_group_parameters', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group', - ], - 'required': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'required_string_group': - (int,), - 'required_boolean_group': - (bool,), - 'required_int64_group': - (int,), - 'string_group': - (int,), - 'boolean_group': - (bool,), - 'int64_group': - (int,), - }, - 'attribute_map': { - 'required_string_group': 'required_string_group', - 'required_boolean_group': 'required_boolean_group', - 'required_int64_group': 'required_int64_group', - 'string_group': 'string_group', - 'boolean_group': 'boolean_group', - 'int64_group': 'int64_group', - }, - 'location_map': { - 'required_string_group': 'query', - 'required_boolean_group': 'header', - 'required_int64_group': 'query', - 'string_group': 'query', - 'boolean_group': 'header', - 'int64_group': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.test_inline_additional_properties_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/inline-additionalProperties', - 'operation_id': 'test_inline_additional_properties', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'request_body', - ], - 'required': [ - 'request_body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'request_body': - ({str: (str,)},), - }, - 'attribute_map': { - }, - 'location_map': { - 'request_body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.test_json_form_data_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/jsonFormData', - 'operation_id': 'test_json_form_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'param', - 'param2', - ], - 'required': [ - 'param', - 'param2', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': - (str,), - 'param2': - (str,), - }, - 'attribute_map': { - 'param': 'param', - 'param2': 'param2', - }, - 'location_map': { - 'param': 'form', - 'param2': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - self.test_query_parameter_collection_format_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/test-query-parameters', - 'operation_id': 'test_query_parameter_collection_format', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context', - ], - 'required': [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pipe': - ([str],), - 'ioutil': - ([str],), - 'http': - ([str],), - 'url': - ([str],), - 'context': - ([str],), - }, - 'attribute_map': { - 'pipe': 'pipe', - 'ioutil': 'ioutil', - 'http': 'http', - 'url': 'url', - 'context': 'context', - }, - 'location_map': { - 'pipe': 'query', - 'ioutil': 'query', - 'http': 'query', - 'url': 'query', - 'context': 'query', - }, - 'collection_format_map': { - 'pipe': 'multi', - 'ioutil': 'csv', - 'http': 'ssv', - 'url': 'csv', - 'context': 'multi', - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.tx_rx_all_of_model_endpoint = _Endpoint( - settings={ - 'response_type': (StreamOptions,), - 'auth': [], - 'endpoint_path': '/fake/TxRxAllOfModel', - 'operation_id': 'tx_rx_all_of_model', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'stream_options', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'stream_options': - (StreamOptions,), - }, - 'attribute_map': { - }, - 'location_map': { - 'stream_options': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.tx_rx_any_of_model_endpoint = _Endpoint( - settings={ - 'response_type': (GmFruitNoProperties,), - 'auth': [], - 'endpoint_path': '/fake/TxRxAnyOfModel', - 'operation_id': 'tx_rx_any_of_model', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'gm_fruit_no_properties', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'gm_fruit_no_properties': - (GmFruitNoProperties,), - }, - 'attribute_map': { - }, - 'location_map': { - 'gm_fruit_no_properties': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.upload_download_file_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [], - 'endpoint_path': '/fake/uploadDownloadFile', - 'operation_id': 'upload_download_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [ - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': - (file_type,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/octet-stream' - ], - 'content_type': [ - 'application/octet-stream' - ] - }, - api_client=api_client - ) - self.upload_file_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [], - 'endpoint_path': '/fake/uploadFile', - 'operation_id': 'upload_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'file', - 'additional_metadata', - ], - 'required': [ - 'file', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'file': - (file_type,), - 'additional_metadata': - (str,), - }, - 'attribute_map': { - 'file': 'file', - 'additional_metadata': 'additionalMetadata', - }, - 'location_map': { - 'file': 'form', - 'additional_metadata': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.upload_files_endpoint = _Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [], - 'endpoint_path': '/fake/uploadFiles', - 'operation_id': 'upload_files', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'files', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'files': - ([file_type],), - }, - 'attribute_map': { - 'files': 'files', - }, - 'location_map': { - 'files': 'form', - }, - 'collection_format_map': { - 'files': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client - ) - - def additional_properties_with_array_of_enums( - self, - **kwargs - ): - """Additional Properties with Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.additional_properties_with_array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AdditionalPropertiesWithArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def array_of_enums( - self, - **kwargs - ): - """Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - array_of_enums (ArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.array_of_enums_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def composed_one_of_number_with_validations( - self, - **kwargs - ): - """composed_one_of_number_with_validations # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.composed_one_of_number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ComposedOneOfNumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) - - def download_attachment( - self, - file_name, - **kwargs - ): - """downloads a file using Content-Disposition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.download_attachment(file_name, async_req=True) - >>> result = thread.get() - - Args: - file_name (str): file name - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['file_name'] = \ - file_name - return self.download_attachment_endpoint.call_with_http_info(**kwargs) - - def enum_test( - self, - **kwargs - ): - """Object contains enum properties and array properties containing enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.enum_test(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_test (EnumTest): Input object. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - EnumTest - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.enum_test_endpoint.call_with_http_info(**kwargs) - - def fake_health_get( - self, - **kwargs - ): - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_health_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - HealthCheckResult - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.fake_health_get_endpoint.call_with_http_info(**kwargs) - - def mammal( - self, - mammal, - **kwargs - ): - """mammal # noqa: E501 - - Test serialization of mammals # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mammal(mammal, async_req=True) - >>> result = thread.get() - - Args: - mammal (Mammal): Input mammal - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Mammal - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['mammal'] = \ - mammal - return self.mammal_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def post_inline_additional_properties_payload( - self, - **kwargs - ): - """post_inline_additional_properties_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - post_inline_additional_properties_payload_request (PostInlineAdditionalPropertiesPayloadRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PostInlineAdditionalPropertiesPayloadRequest - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) - - def post_inline_additional_properties_ref_payload( - self, - **kwargs - ): - """post_inline_additional_properties_ref_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_ref_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InlineAdditionalPropertiesRefPayload - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - file_schema_test_class, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) - >>> result = thread.get() - - Args: - file_schema_test_class (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['file_schema_test_class'] = \ - file_schema_test_class - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - user, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, user, async_req=True) - >>> result = thread.get() - - Args: - query (str): - user (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['query'] = \ - query - kwargs['user'] = \ - user - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - client, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['client'] = \ - client - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - request_body, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(request_body, async_req=True) - >>> result = thread.get() - - Args: - request_body ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['request_body'] = \ - request_body - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - - def test_query_parameter_collection_format( - self, - pipe, - ioutil, - http, - url, - context, - **kwargs - ): - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - Args: - pipe ([str]): - ioutil ([str]): - http ([str]): - url ([str]): - context ([str]): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pipe'] = \ - pipe - kwargs['ioutil'] = \ - ioutil - kwargs['http'] = \ - http - kwargs['url'] = \ - url - kwargs['context'] = \ - context - return self.test_query_parameter_collection_format_endpoint.call_with_http_info(**kwargs) - - def tx_rx_all_of_model( - self, - **kwargs - ): - """tx_rx_all_of_model # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.tx_rx_all_of_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - stream_options (StreamOptions): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - StreamOptions - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.tx_rx_all_of_model_endpoint.call_with_http_info(**kwargs) - - def tx_rx_any_of_model( - self, - **kwargs - ): - """tx_rx_any_of_model # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.tx_rx_any_of_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - gm_fruit_no_properties (GmFruitNoProperties): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - GmFruitNoProperties - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) - - def upload_download_file( - self, - body, - **kwargs - ): - """uploads a file and downloads a file using application/octet-stream # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_download_file(body, async_req=True) - >>> result = thread.get() - - Args: - body (file_type): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['body'] = \ - body - return self.upload_download_file_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - file, - **kwargs - ): - """uploads a file using multipart/form-data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(file, async_req=True) - >>> result = thread.get() - - Args: - file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['file'] = \ - file - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_files( - self, - **kwargs - ): - """uploads files using multipart/form-data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_files(async_req=True) - >>> result = thread.get() - - - Keyword Args: - files ([file_type]): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.upload_files_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py deleted file mode 100644 index 95f69b706e09..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - client, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['client'] = \ - client - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index bc79105589de..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,173 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.test_classname_endpoint = _Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': - (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def test_classname( - self, - client, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) - kwargs['client'] = \ - client - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py deleted file mode 100644 index bbc8fd7ee4c6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1026 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.pet import Pet - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.add_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth', - 'http_signature_test' - ], - 'endpoint_path': '/pet', - 'operation_id': 'add_pet', - 'http_method': 'POST', - 'servers': [ - { - 'url': "http://petstore.swagger.io/v2", - 'description': "No description provided", - }, - { - 'url': "http://path-server-test.petstore.local/v2", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'pet', - ], - 'required': [ - 'pet', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'pet': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.delete_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'delete_pet', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'api_key', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'api_key': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'api_key': 'api_key', - }, - 'location_map': { - 'pet_id': 'path', - 'api_key': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_status_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth', - 'http_signature_test' - ], - 'endpoint_path': '/pet/findByStatus', - 'operation_id': 'find_pets_by_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'status', - ], - 'required': [ - 'status', - ], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('status',): { - - "AVAILABLE": "available", - "PENDING": "pending", - "SOLD": "sold" - }, - }, - 'openapi_types': { - 'status': - ([str],), - }, - 'attribute_map': { - 'status': 'status', - }, - 'location_map': { - 'status': 'query', - }, - 'collection_format_map': { - 'status': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.find_pets_by_tags_endpoint = _Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth', - 'http_signature_test' - ], - 'endpoint_path': '/pet/findByTags', - 'operation_id': 'find_pets_by_tags', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'tags', - ], - 'required': [ - 'tags', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'tags': - ([str],), - }, - 'attribute_map': { - 'tags': 'tags', - }, - 'location_map': { - 'tags': 'query', - }, - 'collection_format_map': { - 'tags': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_pet_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Pet,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'get_pet_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - }, - 'attribute_map': { - 'pet_id': 'petId', - }, - 'location_map': { - 'pet_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_pet_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth', - 'http_signature_test' - ], - 'endpoint_path': '/pet', - 'operation_id': 'update_pet', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "http://petstore.swagger.io/v2", - 'description': "No description provided", - }, - { - 'url': "http://path-server-test.petstore.local/v2", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'pet', - ], - 'required': [ - 'pet', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet': - (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'pet': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client - ) - self.update_pet_with_form_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'update_pet_with_form', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'pet_id', - 'name', - 'status', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': - (int,), - 'name': - (str,), - 'status': - (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'name': 'name', - 'status': 'status', - }, - 'location_map': { - 'pet_id': 'path', - 'name': 'form', - 'status': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client - ) - - def add_pet( - self, - pet, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet'] = \ - pet - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - pet, - **kwargs - ): - """Update an existing pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet'] = \ - pet - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py deleted file mode 100644 index 27adc2c008de..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py +++ /dev/null @@ -1,563 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.order import Order - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.delete_order_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'delete_order', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (str,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_inventory_endpoint = _Endpoint( - settings={ - 'response_type': ({str: (int,)},), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/store/inventory', - 'operation_id': 'get_inventory', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_order_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'get_order_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'order_id', - ] - }, - root_map={ - 'validations': { - ('order_id',): { - - 'inclusive_maximum': 5, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': - (int,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.place_order_endpoint = _Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order', - 'operation_id': 'place_order', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'order', - ], - 'required': [ - 'order', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order': - (Order,), - }, - 'attribute_map': { - }, - 'location_map': { - 'order': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - order, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(order, async_req=True) - >>> result = thread.get() - - Args: - order (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['order'] = \ - order - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py deleted file mode 100644 index 38c7f659bddb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py +++ /dev/null @@ -1,1096 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.api_client import ApiClient, Endpoint as _Endpoint -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from petstore_api.model.user import User - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user', - 'operation_id': 'create_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': - (User,), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.create_users_with_array_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithArray', - 'operation_id': 'create_users_with_array_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.create_users_with_list_input_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithList', - 'operation_id': 'create_users_with_list_input', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': - ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'delete_user', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.get_user_by_name_endpoint = _Endpoint( - settings={ - 'response_type': (User,), - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'get_user_by_name', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.login_user_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/user/login', - 'operation_id': 'login_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'password', - ], - 'required': [ - 'username', - 'password', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'password': - (str,), - }, - 'attribute_map': { - 'username': 'username', - 'password': 'password', - }, - 'location_map': { - 'username': 'query', - 'password': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.logout_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/logout', - 'operation_id': 'logout_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.update_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'update_user', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'username', - 'user', - ], - 'required': [ - 'username', - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': - (str,), - 'user': - (User,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def create_user( - self, - user, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(user, async_req=True) - >>> result = thread.get() - - Args: - user (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['user'] = \ - user - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['user'] = \ - user - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['user'] = \ - user - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - user, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, user, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - user (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _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. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - 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') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['username'] = \ - username - kwargs['user'] = \ - user - return self.update_user_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py deleted file mode 100644 index ad9920c602aa..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py +++ /dev/null @@ -1,905 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField - - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException -from petstore_api.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return (return_data) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, list): - return [cls.sanitize_for_serialization(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(cls.sanitize_for_serialization(item) for item in obj) - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - 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'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = AnotherFakeApi() - api_instance.call_123_test_special_tags # this is an instance of the class Endpoint - api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.call_123_test_special_tags.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] - ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py deleted file mode 100644 index 381ad9572b17..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from petstore_api.api.another_fake_api import AnotherFakeApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py deleted file mode 100644 index aceebf797b60..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py +++ /dev/null @@ -1,617 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from petstore_api.exceptions import ApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param signing_info: Configuration parameters for the HTTP signature security scheme. - Must be an instance of petstore_api.signing.HttpSigningConfiguration - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = petstore_api.Configuration( - username='the-user', - password='the-password', -) - - - HTTP Signature Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: signature - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is because explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - -conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = petstore_api.signing.SCHEME_HS2019, - signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, - signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET, - petstore_api.signing.HEADER_CREATED, - petstore_api.signing.HEADER_EXPIRES, - petstore_api.signing.HEADER_HOST, - petstore_api.signing.HEADER_DATE, - petstore_api.signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) -) - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - signing_info=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ - self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - if name == "signing_info" and value is not None: - # Ensure the host parameter from signing info is the same as - # Configuration.host. - value.host = self.host - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['petstore_auth'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if 'api_key' in self.api_key: - auth['api_key'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix( - 'api_key', - ), - } - if 'api_key_query' in self.api_key: - auth['api_key_query'] = { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix( - 'api_key_query', - ), - } - if self.username is not None and self.password is not None: - auth['http_basic_test'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - } - if self.access_token is not None: - auth['bearer_test'] = { - 'type': 'bearer', - 'in': 'header', - 'format': 'JWT', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - if self.signing_info is not None: - auth['http_signature_test'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://{server}.swagger.io:{port}/v2", - 'description': "petstore server", - 'variables': { - 'server': { - 'description': "No description provided", - 'default_value': "petstore", - 'enum_values': [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - 'port': { - 'description': "No description provided", - 'default_value': "80", - 'enum_values': [ - "80", - "8080" - ] - } - } - }, - { - 'url': "https://localhost:8080/{version}", - 'description': "The local server", - 'variables': { - 'version': { - 'description': "No description provided", - 'default_value': "v2", - 'enum_values': [ - "v1", - "v2" - ] - } - } - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py deleted file mode 100644 index d223cb4876ce..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py +++ /dev/null @@ -1,158 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py deleted file mode 100644 index 027452f37a87..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# 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 petstore_api.models import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py deleted file mode 100644 index 307a8c772ff0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'map_property': ({str: (str,)},), # noqa: E501 - 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 - 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'map_with_undeclared_properties_anytype_1': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'map_with_undeclared_properties_anytype_2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'map_with_undeclared_properties_anytype_3': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'empty_map': (dict,), # noqa: E501 - 'map_with_undeclared_properties_string': ({str: (str,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_property': 'map_property', # noqa: E501 - 'map_of_map_property': 'map_of_map_property', # noqa: E501 - 'anytype_1': 'anytype_1', # noqa: E501 - 'map_with_undeclared_properties_anytype_1': 'map_with_undeclared_properties_anytype_1', # noqa: E501 - 'map_with_undeclared_properties_anytype_2': 'map_with_undeclared_properties_anytype_2', # noqa: E501 - 'map_with_undeclared_properties_anytype_3': 'map_with_undeclared_properties_anytype_3', # noqa: E501 - 'empty_map': 'empty_map', # noqa: E501 - 'map_with_undeclared_properties_string': 'map_with_undeclared_properties_string', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_property ({str: (str,)}): [optional] # noqa: E501 - map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 - map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_property ({str: (str,)}): [optional] # noqa: E501 - map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 - map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py deleted file mode 100644 index 9b33b4689d5f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,265 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.enum_class import EnumClass - globals()['EnumClass'] = EnumClass - - -class AdditionalPropertiesWithArrayOfEnums(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ([EnumClass],) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py deleted file mode 100644 index 6ab145672442..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py +++ /dev/null @@ -1,259 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Address(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (int,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py deleted file mode 100644 index b93180ea0559..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.cat import Cat - from petstore_api.model.dog import Dog - globals()['Cat'] = Cat - globals()['Dog'] = Dog - - -class Animal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Cat': Cat, - 'Dog': Dog, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py deleted file mode 100644 index 89062cff69cb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class AnimalFarm(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([Animal],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py deleted file mode 100644 index 5e21cdaf5988..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py +++ /dev/null @@ -1,271 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ApiResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'code': (int,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'code': 'code', # noqa: E501 - 'type': 'type', # noqa: E501 - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py deleted file mode 100644 index 9909e1994ab7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Apple(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'cultivar': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 - """Apple - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """Apple - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py deleted file mode 100644 index ce9ae6721e57..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class AppleReq(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'cultivar': (str,), # noqa: E501 - 'mealy': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'mealy': 'mealy', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 - """AppleReq - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """AppleReq - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py deleted file mode 100644 index 41e90e2ae966..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_array_number': ([[float]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py deleted file mode 100644 index 8ca15fd6c8fb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_enum import StringEnum - globals()['StringEnum'] = StringEnum - - -class ArrayOfEnums(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([StringEnum],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ArrayOfEnums - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([StringEnum]): # noqa: E501 - - Keyword Args: - value ([StringEnum]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ArrayOfEnums - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([StringEnum]): # noqa: E501 - - Keyword Args: - value ([StringEnum]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py deleted file mode 100644 index 068dc80b1a90..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_number': ([float],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_number': 'ArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py deleted file mode 100644 index 119a5ad1fdd0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.read_only_first import ReadOnlyFirst - globals()['ReadOnlyFirst'] = ReadOnlyFirst - - -class ArrayTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_of_string': ([str],), # noqa: E501 - 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_of_string': 'array_of_string', # noqa: E501 - 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py deleted file mode 100644 index f6f6792990d8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Banana(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'length_cm': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'length_cm': 'lengthCm', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 - """Banana - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """Banana - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py deleted file mode 100644 index 1e6d97d13430..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class BananaReq(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'length_cm': (float,), # noqa: E501 - 'sweet': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'length_cm': 'lengthCm', # noqa: E501 - 'sweet': 'sweet', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 - """BananaReq - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sweet (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """BananaReq - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sweet (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py deleted file mode 100644 index 456066d2ce5e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class BasquePig(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """BasquePig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """BasquePig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py deleted file mode 100644 index e4002fb8f622..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py +++ /dev/null @@ -1,281 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class BooleanEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'TRUE': True, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (bool,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """BooleanEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - - Keyword Args: - value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = True - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """BooleanEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - - Keyword Args: - value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = True - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py deleted file mode 100644 index d57e30d2c85e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Capitalization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'small_camel': (str,), # noqa: E501 - 'capital_camel': (str,), # noqa: E501 - 'small_snake': (str,), # noqa: E501 - 'capital_snake': (str,), # noqa: E501 - 'sca_eth_flow_points': (str,), # noqa: E501 - 'att_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'small_camel': 'smallCamel', # noqa: E501 - 'capital_camel': 'CapitalCamel', # noqa: E501 - 'small_snake': 'small_Snake', # noqa: E501 - 'capital_snake': 'Capital_Snake', # noqa: E501 - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py deleted file mode 100644 index 04a16c49115e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py +++ /dev/null @@ -1,338 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.cat_all_of import CatAllOf - globals()['Animal'] = Animal - globals()['CatAllOf'] = CatAllOf - - -class Cat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'declawed': (bool,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'declawed': 'declawed', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - CatAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py deleted file mode 100644 index f4e32d0b736a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class CatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'declawed': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'declawed': 'declawed', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py deleted file mode 100644 index 21fb7bd65b51..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py +++ /dev/null @@ -1,275 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Category(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'id': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'id': 'id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py deleted file mode 100644 index 6d971fd192aa..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py +++ /dev/null @@ -1,329 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat_all_of import ChildCatAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCatAllOf'] = ChildCatAllOf - globals()['ParentPet'] = ParentPet - - -class ChildCat(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildCatAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py deleted file mode 100644 index 92d2a18ab707..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ChildCatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCatAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py deleted file mode 100644 index cbbd0ff1e81c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ClassModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_class': '_class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py deleted file mode 100644 index 82c5a6ed6bb4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Client(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'client': 'client', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py deleted file mode 100644 index 3ad5b7a7180f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.quadrilateral_interface import QuadrilateralInterface - from petstore_api.model.shape_interface import ShapeInterface - globals()['QuadrilateralInterface'] = QuadrilateralInterface - globals()['ShapeInterface'] = ShapeInterface - - -class ComplexQuadrilateral(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ComplexQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ComplexQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - QuadrilateralInterface, - ShapeInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py deleted file mode 100644 index 5dfc7dcb8cd9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py +++ /dev/null @@ -1,333 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.number_with_validations import NumberWithValidations - globals()['Animal'] = Animal - globals()['NumberWithValidations'] = NumberWithValidations - - -class ComposedOneOfNumberWithValidations(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - 'class_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ComposedOneOfNumberWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - class_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ComposedOneOfNumberWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - class_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Animal, - NumberWithValidations, - date, - none_type, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py deleted file mode 100644 index b9324a12c8e8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py +++ /dev/null @@ -1,320 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.tag import Tag - globals()['Tag'] = Tag - - -class ComposedSchemaWithPropsAndNoAddProps(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'color': (str,), # noqa: E501 - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'color': 'color', # noqa: E501 - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ComposedSchemaWithPropsAndNoAddProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ComposedSchemaWithPropsAndNoAddProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Tag, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py deleted file mode 100644 index 3a37b353933c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class DanishPig(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """DanishPig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """DanishPig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py deleted file mode 100644 index f5b4d580f081..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py +++ /dev/null @@ -1,344 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.dog_all_of import DogAllOf - from petstore_api.model.legs import Legs - globals()['Animal'] = Animal - globals()['DogAllOf'] = DogAllOf - globals()['Legs'] = Legs - - -class Dog(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'breed': (str,), # noqa: E501 - 'legs': (Legs,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'breed': 'breed', # noqa: E501 - 'legs': 'legs', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - DogAllOf, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py deleted file mode 100644 index c9d98095446b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.legs import Legs - globals()['Legs'] = Legs - - -class DogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'breed': (str,), # noqa: E501 - 'legs': (Legs,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'breed': 'breed', # noqa: E501 - 'legs': 'legs', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py deleted file mode 100644 index c08b8d2a0bee..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py +++ /dev/null @@ -1,287 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.fruit import Fruit - from petstore_api.model.nullable_shape import NullableShape - from petstore_api.model.shape import Shape - from petstore_api.model.shape_or_null import ShapeOrNull - globals()['Fruit'] = Fruit - globals()['NullableShape'] = NullableShape - globals()['Shape'] = Shape - globals()['ShapeOrNull'] = ShapeOrNull - - -class Drawing(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (Fruit,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'main_shape': (Shape,), # noqa: E501 - 'shape_or_null': (ShapeOrNull,), # noqa: E501 - 'nullable_shape': (NullableShape,), # noqa: E501 - 'shapes': ([Shape],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'main_shape': 'mainShape', # noqa: E501 - 'shape_or_null': 'shapeOrNull', # noqa: E501 - 'nullable_shape': 'nullableShape', # noqa: E501 - 'shapes': 'shapes', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Drawing - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - main_shape (Shape): [optional] # noqa: E501 - shape_or_null (ShapeOrNull): [optional] # noqa: E501 - nullable_shape (NullableShape): [optional] # noqa: E501 - shapes ([Shape]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Drawing - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - main_shape (Shape): [optional] # noqa: E501 - shape_or_null (ShapeOrNull): [optional] # noqa: E501 - nullable_shape (NullableShape): [optional] # noqa: E501 - shapes ([Shape]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py deleted file mode 100644 index e4ba9523546a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EgressThresholdOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'egress_thresholds': ({str: (float,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'egress_thresholds': 'egressThresholds', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EgressThresholdOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_thresholds ({str: (float,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EgressThresholdOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_thresholds ({str: (float,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py deleted file mode 100644 index 65b981ab7be3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py +++ /dev/null @@ -1,275 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumArrays(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('just_symbol',): { - '>=': ">=", - '$': "$", - }, - ('array_enum',): { - 'FISH': "fish", - 'CRAB': "crab", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_symbol': (str,), # noqa: E501 - 'array_enum': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py deleted file mode 100644 index bf9b682bd05d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class EnumClass(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py deleted file mode 100644 index dd47ea4f74c2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.array_of_enums import ArrayOfEnums - from petstore_api.model.boolean_enum import BooleanEnum - from petstore_api.model.integer_enum import IntegerEnum - from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue - from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue - from petstore_api.model.string_enum import StringEnum - from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue - globals()['ArrayOfEnums'] = ArrayOfEnums - globals()['BooleanEnum'] = BooleanEnum - globals()['IntegerEnum'] = IntegerEnum - globals()['IntegerEnumOneValue'] = IntegerEnumOneValue - globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue - globals()['StringEnum'] = StringEnum - globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue - - -class EnumTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('enum_string_required',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_integer',): { - '1': 1, - '-1': -1, - }, - ('enum_number',): { - '1.1': 1.1, - '-1.2': -1.2, - }, - ('enum_bool',): { - 'FALSE': False, - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'enum_string_required': (str,), # noqa: E501 - 'enum_string': (str,), # noqa: E501 - 'enum_integer': (int,), # noqa: E501 - 'enum_number': (float,), # noqa: E501 - 'enum_bool': (bool,), # noqa: E501 - 'bool_enum': (BooleanEnum,), # noqa: E501 - 'string_enum': (StringEnum,), # noqa: E501 - 'integer_enum': (IntegerEnum,), # noqa: E501 - 'string_enum_with_default_value': (StringEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_with_default_value': (IntegerEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_one_value': (IntegerEnumOneValue,), # noqa: E501 - 'inline_array_of_str_enum': ([StringEnum],), # noqa: E501 - 'array_of_str_enum': (ArrayOfEnums,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'enum_string_required': 'enum_string_required', # noqa: E501 - 'enum_string': 'enum_string', # noqa: E501 - 'enum_integer': 'enum_integer', # noqa: E501 - 'enum_number': 'enum_number', # noqa: E501 - 'enum_bool': 'enum_bool', # noqa: E501 - 'bool_enum': 'boolEnum', # noqa: E501 - 'string_enum': 'stringEnum', # noqa: E501 - 'integer_enum': 'IntegerEnum', # noqa: E501 - 'string_enum_with_default_value': 'StringEnumWithDefaultValue', # noqa: E501 - 'integer_enum_with_default_value': 'IntegerEnumWithDefaultValue', # noqa: E501 - 'integer_enum_one_value': 'IntegerEnumOneValue', # noqa: E501 - 'inline_array_of_str_enum': 'InlineArrayOfStrEnum', # noqa: E501 - 'array_of_str_enum': 'ArrayOfStrEnum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - bool_enum (BooleanEnum): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - integer_enum (IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 - inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 - array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - bool_enum (BooleanEnum): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - integer_enum (IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 - inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 - array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py deleted file mode 100644 index 47e8e9a64f18..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - - -class EquilateralTriangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EquilateralTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EquilateralTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py deleted file mode 100644 index 3e3afcf462bc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class FakePostInlineAdditionalPropertiesPayloadArrayData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'labels': ([str, none_type],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'labels': 'labels', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FakePostInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([str, none_type]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FakePostInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([str, none_type]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py deleted file mode 100644 index 6d8d65f45752..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class File(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'source_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'source_uri': 'sourceURI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py deleted file mode 100644 index d8db617ffa80..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.file import File - globals()['File'] = File - - -class FileSchemaTestClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'file': (File,), # noqa: E501 - 'files': ([File],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'file': 'file', # noqa: E501 - 'files': 'files', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py deleted file mode 100644 index fd07a6d8ade3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Foo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Foo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Foo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py deleted file mode 100644 index c5222f834a81..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.foo import Foo - globals()['Foo'] = Foo - - -class FooGetDefaultResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'string': (Foo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string': 'string', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FooGetDefaultResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - string (Foo): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FooGetDefaultResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - string (Foo): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py deleted file mode 100644 index 73ae897b8ef2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class FooObject(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'prop1': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}],), # noqa: E501 - 'prop2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'prop1': 'prop1', # noqa: E501 - 'prop2': 'prop2', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FooObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - prop1 ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): [optional] # noqa: E501 - prop2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FooObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - prop1 ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): [optional] # noqa: E501 - prop2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py deleted file mode 100644 index 5b425f42332d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py +++ /dev/null @@ -1,378 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class FormatTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - 'multiple_of': 32.5, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - 'multiple_of': 2, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - 'inclusive_maximum': 987.6, - 'inclusive_minimum': 54.3, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('pattern_with_digits',): { - 'regex': { - 'pattern': r'^\d{10}$', # noqa: E501 - }, - }, - ('pattern_with_digits_and_delimiter',): { - 'regex': { - 'pattern': r'^image_\d{1,3}$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'number': (float,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'uuid': (str,), # noqa: E501 - 'uuid_no_example': (str,), # noqa: E501 - 'pattern_with_digits': (str,), # noqa: E501 - 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'number': 'number', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'date': 'date', # noqa: E501 - 'password': 'password', # noqa: E501 - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'uuid': 'uuid', # noqa: E501 - 'uuid_no_example': 'uuidNoExample', # noqa: E501 - 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 - 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - uuid_no_example (str): [optional] # noqa: E501 - pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 - pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - uuid_no_example (str): [optional] # noqa: E501 - pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 - pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py deleted file mode 100644 index 79952ac853aa..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py +++ /dev/null @@ -1,345 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.apple import Apple - from petstore_api.model.banana import Banana - globals()['Apple'] = Apple - globals()['Banana'] = Banana - - -class Fruit(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - 'color': 'color', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Fruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Fruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Apple, - Banana, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py deleted file mode 100644 index 62fdc158f582..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py +++ /dev/null @@ -1,335 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.apple_req import AppleReq - from petstore_api.model.banana_req import BananaReq - globals()['AppleReq'] = AppleReq - globals()['BananaReq'] = BananaReq - - -class FruitReq(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'mealy': (bool,), # noqa: E501 - 'sweet': (bool,), # noqa: E501 - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'mealy': 'mealy', # noqa: E501 - 'sweet': 'sweet', # noqa: E501 - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FruitReq - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - sweet (bool): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FruitReq - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - sweet (bool): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - AppleReq, - BananaReq, - none_type, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py deleted file mode 100644 index 93f102967ff3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py +++ /dev/null @@ -1,345 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.apple import Apple - from petstore_api.model.banana import Banana - globals()['Apple'] = Apple - globals()['Banana'] = Banana - - -class GmFruit(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - 'color': 'color', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """GmFruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """GmFruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - Apple, - Banana, - ], - 'allOf': [ - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py deleted file mode 100644 index c215e1764b08..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py +++ /dev/null @@ -1,341 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.apple import Apple - from petstore_api.model.banana import Banana - globals()['Apple'] = Apple - globals()['Banana'] = Banana - - -class GmFruitNoProperties(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'origin': (str,), # noqa: E501 - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'origin': 'origin', # noqa: E501 - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """GmFruitNoProperties - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """GmFruitNoProperties - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - Apple, - Banana, - ], - 'allOf': [ - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py deleted file mode 100644 index f6d1b0bb2043..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCat'] = ChildCat - globals()['ParentPet'] = ParentPet - - -class GrandparentAnimal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ParentPet': ParentPet, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py deleted file mode 100644 index 1ccc67be07a1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class HasOnlyReadOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'foo': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'foo': 'foo', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - 'foo', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py deleted file mode 100644 index e0f31297fe00..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class HealthCheckResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'nullable_message': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'nullable_message': 'NullableMessage', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - nullable_message (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - nullable_message (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py deleted file mode 100644 index 93902416ece9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - - -class InlineAdditionalPropertiesRefPayload(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_data': ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_data': 'arrayData', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InlineAdditionalPropertiesRefPayload - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """InlineAdditionalPropertiesRefPayload - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py deleted file mode 100644 index f86bf6e9ccad..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData - globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData - - -class InlineObject6(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_data': ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_data': 'arrayData', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InlineObject6 - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """InlineObject6 - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py deleted file mode 100644 index 5c3edc3a45d9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.foo import Foo - globals()['Foo'] = Foo - - -class InlineResponseDefault(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'string': (Foo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'string': 'string', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InlineResponseDefault - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - string (Foo): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """InlineResponseDefault - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - string (Foo): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py deleted file mode 100644 index de46d21f64f6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class IntegerEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int):, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int):, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py deleted file mode 100644 index 9091039a21a8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py +++ /dev/null @@ -1,281 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class IntegerEnumOneValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '0': 0, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnumOneValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnumOneValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py deleted file mode 100644 index f3473cffa273..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class IntegerEnumWithDefaultValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py deleted file mode 100644 index 162f8fedb53a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - - -class IsoscelesTriangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """IsoscelesTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """IsoscelesTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py deleted file mode 100644 index cb5c157e2b53..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py +++ /dev/null @@ -1,279 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Legs(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('legs',): { - '2': "2", - '4': "4", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'legs': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'legs': 'legs', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Legs - a model defined in OpenAPI - - Args: - - Keyword Args: - legs (str): defaults to "4", must be one of ["2", "4", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - legs = kwargs.get('legs', "4") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.legs = legs - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Legs - a model defined in OpenAPI - - Args: - - Keyword Args: - legs (str): defaults to "4", must be one of ["2", "4", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - legs = kwargs.get('legs', "4") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.legs = legs - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py deleted file mode 100644 index 1dfa33efc320..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class List(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_123_list': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_123_list': '123-list', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _123_list (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py deleted file mode 100644 index 0a2d927ea7ac..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py +++ /dev/null @@ -1,349 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.pig import Pig - from petstore_api.model.whale import Whale - from petstore_api.model.zebra import Zebra - globals()['Pig'] = Pig - globals()['Whale'] = Whale - globals()['Zebra'] = Zebra - - -class Mammal(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'PLAINS': "plains", - 'MOUNTAIN': "mountain", - 'GREVYS': "grevys", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'has_baleen': (bool,), # noqa: E501 - 'has_teeth': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Pig': Pig, - 'whale': Whale, - 'zebra': Zebra, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'has_baleen': 'hasBaleen', # noqa: E501 - 'has_teeth': 'hasTeeth', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Mammal - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Mammal - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Pig, - Whale, - Zebra, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py deleted file mode 100644 index eccf9c9e610c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py +++ /dev/null @@ -1,285 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.string_boolean_map import StringBooleanMap - globals()['StringBooleanMap'] = StringBooleanMap - - -class MapTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('map_of_enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_of_enum_string': ({str: (str,)},), # noqa: E501 - 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (StringBooleanMap,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', # noqa: E501 - 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 - 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 4d825b8dd46d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - - -class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'uuid': (str,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (Animal,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'uuid': 'uuid', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'map': 'map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py deleted file mode 100644 index 9bebea2423fd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py deleted file mode 100644 index d2f97900d188..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Model_200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model_200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py deleted file mode 100644 index f3bd5123dd74..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ModelReturn(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_return': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_return': 'return', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py deleted file mode 100644 index 0e149e15f5ff..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Mole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'blind': (bool,), # noqa: E501 - 'smell': (str,), # noqa: E501 - 'hearing': (bool,), # noqa: E501 - 'touch': (bool,), # noqa: E501 - 'taste': (str,), # noqa: E501 - 'seeing_ghosts': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'blind': 'blind', # noqa: E501 - 'smell': 'smell', # noqa: E501 - 'hearing': 'hearing', # noqa: E501 - 'touch': 'touch', # noqa: E501 - 'taste': 'taste', # noqa: E501 - 'seeing_ghosts': 'seeingGhosts', # noqa: E501 - } - - read_only_vars = { - 'blind', # noqa: E501 - 'touch', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, blind, smell, hearing, *args, **kwargs): # noqa: E501 - """Mole - a model defined in OpenAPI - - Args: - blind (bool): - smell (str): - hearing (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - touch (bool): [optional] # noqa: E501 - taste (str): [optional] # noqa: E501 - seeing_ghosts (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.blind = blind - self.smell = smell - self.hearing = hearing - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, smell, hearing, *args, **kwargs): # noqa: E501 - """Mole - a model defined in OpenAPI - - smell (str): - hearing (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - touch (bool): [optional] # noqa: E501 - taste (str): [optional] # noqa: E501 - seeing_ghosts (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.smell = smell - self.hearing = hearing - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py deleted file mode 100644 index aec8c8b900cb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Name(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - 'snake_case': (int,), # noqa: E501 - '_property': (str,), # noqa: E501 - '_123_number': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'snake_case': 'snake_case', # noqa: E501 - '_property': 'property', # noqa: E501 - '_123_number': '123Number', # noqa: E501 - } - - read_only_vars = { - 'snake_case', # noqa: E501 - '_123_number', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py deleted file mode 100644 index 0c6765a33ca5..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py +++ /dev/null @@ -1,311 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NullableClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'integer_prop': (int, none_type,), # noqa: E501 - 'number_prop': (float, none_type,), # noqa: E501 - 'boolean_prop': (bool, none_type,), # noqa: E501 - 'string_prop': (str, none_type,), # noqa: E501 - 'date_prop': (date, none_type,), # noqa: E501 - 'datetime_prop': (datetime, none_type,), # noqa: E501 - 'array_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type,), # noqa: E501 - 'array_and_items_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type,), # noqa: E501 - 'array_items_nullable': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type],), # noqa: E501 - 'object_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'object_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type,), # noqa: E501 - 'object_and_items_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type,), # noqa: E501 - 'object_items_nullable': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'integer_prop': 'integer_prop', # noqa: E501 - 'number_prop': 'number_prop', # noqa: E501 - 'boolean_prop': 'boolean_prop', # noqa: E501 - 'string_prop': 'string_prop', # noqa: E501 - 'date_prop': 'date_prop', # noqa: E501 - 'datetime_prop': 'datetime_prop', # noqa: E501 - 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 - 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 - 'array_items_nullable': 'array_items_nullable', # noqa: E501 - 'object_nullable': 'object_nullable', # noqa: E501 - 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 - 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 - 'object_items_nullable': 'object_items_nullable', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NullableClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer_prop (int, none_type): [optional] # noqa: E501 - number_prop (float, none_type): [optional] # noqa: E501 - boolean_prop (bool, none_type): [optional] # noqa: E501 - string_prop (str, none_type): [optional] # noqa: E501 - date_prop (date, none_type): [optional] # noqa: E501 - datetime_prop (datetime, none_type): [optional] # noqa: E501 - array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 - array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 - array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 - object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 - object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 - object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 - object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NullableClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer_prop (int, none_type): [optional] # noqa: E501 - number_prop (float, none_type): [optional] # noqa: E501 - boolean_prop (bool, none_type): [optional] # noqa: E501 - string_prop (str, none_type): [optional] # noqa: E501 - date_prop (date, none_type): [optional] # noqa: E501 - datetime_prop (datetime, none_type): [optional] # noqa: E501 - array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 - array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 - array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 - object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 - object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 - object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 - object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py deleted file mode 100644 index 75aad1b1b010..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py +++ /dev/null @@ -1,336 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - - -class NullableShape(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NullableShape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NullableShape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py deleted file mode 100644 index 7a586085d7c1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_number': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_number': 'JustNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py deleted file mode 100644 index 67e019ad54db..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py +++ /dev/null @@ -1,290 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class NumberWithValidations(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('value',): { - 'inclusive_maximum': 20, - 'inclusive_minimum': 10, - }, - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (float,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py deleted file mode 100644 index 4f9e0edf9862..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py +++ /dev/null @@ -1,259 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ObjectInterface(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectInterface - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectInterface - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py deleted file mode 100644 index 085a1533c4bd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.number_with_validations import NumberWithValidations - from petstore_api.model.readonly import Readonly - globals()['NumberWithValidations'] = NumberWithValidations - globals()['Readonly'] = Readonly - - -class ObjectModelWithRefProps(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'my_number': (NumberWithValidations,), # noqa: E501 - 'my_readonly': (Readonly,), # noqa: E501 - 'my_string': (str,), # noqa: E501 - 'my_boolean': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'my_number': 'my_number', # noqa: E501 - 'my_readonly': 'my_readonly', # noqa: E501 - 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_readonly (Readonly): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_readonly (Readonly): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py deleted file mode 100644 index 16e0c1f1a2d3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py +++ /dev/null @@ -1,262 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ObjectWithValidations(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('value',): { - 'min_properties': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py deleted file mode 100644 index 98fe0b869760..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Order(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'pet_id': (int,), # noqa: E501 - 'quantity': (int,), # noqa: E501 - 'ship_date': (datetime,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'complete': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'pet_id': 'petId', # noqa: E501 - 'quantity': 'quantity', # noqa: E501 - 'ship_date': 'shipDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'complete': 'complete', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py deleted file mode 100644 index 8d94006f1591..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.grandparent_animal import GrandparentAnimal - globals()['ChildCat'] = ChildCat - globals()['GrandparentAnimal'] = GrandparentAnimal - - -class ParentPet(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - GrandparentAnimal, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py deleted file mode 100644 index 5eb4041e91d0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py +++ /dev/null @@ -1,304 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - globals()['Category'] = Category - globals()['Tag'] = Tag - - -class Pet(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'AVAILABLE': "available", - 'PENDING': "pending", - 'SOLD': "sold", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'photo_urls': ([str],), # noqa: E501 - 'id': (int,), # noqa: E501 - 'category': (Category,), # noqa: E501 - 'tags': ([Tag],), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 - 'id': 'id', # noqa: E501 - 'category': 'category', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py deleted file mode 100644 index 5c9bcc5bd034..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py +++ /dev/null @@ -1,328 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.basque_pig import BasquePig - from petstore_api.model.danish_pig import DanishPig - globals()['BasquePig'] = BasquePig - globals()['DanishPig'] = DanishPig - - -class Pig(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'BasquePig': BasquePig, - 'DanishPig': DanishPig, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Pig - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Pig - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - BasquePig, - DanishPig, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py deleted file mode 100644 index d567ee4402e5..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - - -class PostInlineAdditionalPropertiesPayloadRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_data': ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_data': 'arrayData', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PostInlineAdditionalPropertiesPayloadRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PostInlineAdditionalPropertiesPayloadRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py deleted file mode 100644 index e8bba023a90b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'labels': ([str, none_type],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'labels': 'labels', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([str, none_type]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([str, none_type]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py deleted file mode 100644 index 1bcba6c3b88f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.publish_options_publish import PublishOptionsPublish - globals()['PublishOptionsPublish'] = PublishOptionsPublish - - -class PublishOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'publish': (PublishOptionsPublish,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'publish': 'publish', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PublishOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - publish (PublishOptionsPublish): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PublishOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - publish (PublishOptionsPublish): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py deleted file mode 100644 index e6231b2abff9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class PublishOptionsPublish(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'egress_unknown_detections': (bool,), # noqa: E501 - 'filter_zero_detections': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'egress_unknown_detections': 'egressUnknownDetections', # noqa: E501 - 'filter_zero_detections': 'filterZeroDetections', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PublishOptionsPublish - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_unknown_detections (bool): [optional] # noqa: E501 - filter_zero_detections (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PublishOptionsPublish - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_unknown_detections (bool): [optional] # noqa: E501 - filter_zero_detections (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py deleted file mode 100644 index ddb76e43e806..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py +++ /dev/null @@ -1,332 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral - from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral - globals()['ComplexQuadrilateral'] = ComplexQuadrilateral - globals()['SimpleQuadrilateral'] = SimpleQuadrilateral - - -class Quadrilateral(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'quadrilateral_type': (str,), # noqa: E501 - 'shape_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ComplexQuadrilateral': ComplexQuadrilateral, - 'SimpleQuadrilateral': SimpleQuadrilateral, - } - if not val: - return None - return {'quadrilateral_type': val} - - attribute_map = { - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'shape_type': 'shapeType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Quadrilateral - a model defined in OpenAPI - - Keyword Args: - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Quadrilateral - a model defined in OpenAPI - - Keyword Args: - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - ComplexQuadrilateral, - SimpleQuadrilateral, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py deleted file mode 100644 index 9f61569c9c04..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class QuadrilateralInterface(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'quadrilateral_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, quadrilateral_type, *args, **kwargs): # noqa: E501 - """QuadrilateralInterface - a model defined in OpenAPI - - Args: - quadrilateral_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.quadrilateral_type = quadrilateral_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """QuadrilateralInterface - a model defined in OpenAPI - - Args: - quadrilateral_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.quadrilateral_type = quadrilateral_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py deleted file mode 100644 index 965325c2864d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ReadOnlyFirst(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'baz': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'baz': 'baz', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py deleted file mode 100644 index fc085618b95f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Readonly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Readonly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Readonly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py deleted file mode 100644 index 6a7bfe81bd82..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - - -class ScaleneTriangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ScaleneTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ScaleneTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py deleted file mode 100644 index 025657240278..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py +++ /dev/null @@ -1,336 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - - -class Shape(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py deleted file mode 100644 index c72aea42b725..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ShapeInterface(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'shape_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, shape_type, *args, **kwargs): # noqa: E501 - """ShapeInterface - a model defined in OpenAPI - - Args: - shape_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.shape_type = shape_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """ShapeInterface - a model defined in OpenAPI - - Args: - shape_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.shape_type = shape_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py deleted file mode 100644 index 28bd8ecd4b5a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py +++ /dev/null @@ -1,337 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - - -class ShapeOrNull(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ShapeOrNull - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ShapeOrNull - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - none_type, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py deleted file mode 100644 index 7c342851203f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.quadrilateral_interface import QuadrilateralInterface - from petstore_api.model.shape_interface import ShapeInterface - globals()['QuadrilateralInterface'] = QuadrilateralInterface - globals()['ShapeInterface'] = ShapeInterface - - -class SimpleQuadrilateral(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SimpleQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SimpleQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - QuadrilateralInterface, - ShapeInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py deleted file mode 100644 index cee41c9aa7f1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py +++ /dev/null @@ -1,315 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.object_interface import ObjectInterface - globals()['ObjectInterface'] = ObjectInterface - - -class SomeObject(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SomeObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SomeObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ObjectInterface, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py deleted file mode 100644 index c6e04bc0342d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SomeObjectWithSelfAttr(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_self': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_self': 'self', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SomeObjectWithSelfAttr - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _self (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SomeObjectWithSelfAttr - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _self (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py deleted file mode 100644 index 6044e5e10084..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py +++ /dev/null @@ -1,263 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class SpecialModelName(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'special_property_name': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'special_property_name': '$special[property.name]', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py deleted file mode 100644 index 0a6e6fc06c95..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py +++ /dev/null @@ -1,328 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.egress_threshold_options import EgressThresholdOptions - from petstore_api.model.publish_options import PublishOptions - from petstore_api.model.publish_options_publish import PublishOptionsPublish - globals()['EgressThresholdOptions'] = EgressThresholdOptions - globals()['PublishOptions'] = PublishOptions - globals()['PublishOptionsPublish'] = PublishOptionsPublish - - -class StreamOptions(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'egress_thresholds': ({str: (float,)},), # noqa: E501 - 'publish': (PublishOptionsPublish,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'egress_thresholds': 'egressThresholds', # noqa: E501 - 'publish': 'publish', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StreamOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_thresholds ({str: (float,)}): [optional] # noqa: E501 - publish (PublishOptionsPublish): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StreamOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - egress_thresholds ({str: (float,)}): [optional] # noqa: E501 - publish (PublishOptionsPublish): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - EgressThresholdOptions, - PublishOptions, - ], - 'oneOf': [ - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py deleted file mode 100644 index 52b6f39964bd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py +++ /dev/null @@ -1,259 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringBooleanMap(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py deleted file mode 100644 index 0fbdcdc6af33..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - 'SINGLE_QUOTED': "single quoted", - 'MULTIPLE_LINES': '''multiple -lines''', - 'DOUBLE_QUOTE_WITH_NEWLINE': '''double quote - with newline''', - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py deleted file mode 100644 index 37775c93ca08..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class StringEnumWithDefaultValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "placed" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "placed" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py deleted file mode 100644 index b56728bb6bda..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Tag(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py deleted file mode 100644 index fd9103c96bd6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py +++ /dev/null @@ -1,336 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - -def lazy_import(): - from petstore_api.model.equilateral_triangle import EquilateralTriangle - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - from petstore_api.model.scalene_triangle import ScaleneTriangle - globals()['EquilateralTriangle'] = EquilateralTriangle - globals()['IsoscelesTriangle'] = IsoscelesTriangle - globals()['ScaleneTriangle'] = ScaleneTriangle - - -class Triangle(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'triangle_type': (str,), # noqa: E501 - 'shape_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'EquilateralTriangle': EquilateralTriangle, - 'IsoscelesTriangle': IsoscelesTriangle, - 'ScaleneTriangle': ScaleneTriangle, - } - if not val: - return None - return {'triangle_type': val} - - attribute_map = { - 'triangle_type': 'triangleType', # noqa: E501 - 'shape_type': 'shapeType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - EquilateralTriangle, - IsoscelesTriangle, - ScaleneTriangle, - ], - } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py deleted file mode 100644 index 3bb817d86bcc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py +++ /dev/null @@ -1,269 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class TriangleInterface(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, triangle_type, *args, **kwargs): # noqa: E501 - """TriangleInterface - a model defined in OpenAPI - - Args: - triangle_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.triangle_type = triangle_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """TriangleInterface - a model defined in OpenAPI - - Args: - triangle_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.triangle_type = triangle_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py deleted file mode 100644 index a8056b29a293..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'username': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'user_status': (int,), # noqa: E501 - 'object_with_no_declared_props': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'object_with_no_declared_props_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'any_type_prop': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'any_type_prop_nullable': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'username': 'username', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'email': 'email', # noqa: E501 - 'password': 'password', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus', # noqa: E501 - 'object_with_no_declared_props': 'objectWithNoDeclaredProps', # noqa: E501 - 'object_with_no_declared_props_nullable': 'objectWithNoDeclaredPropsNullable', # noqa: E501 - 'any_type_prop': 'anyTypeProp', # noqa: E501 - 'any_type_prop_nullable': 'anyTypePropNullable', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 - object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 - any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 - any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 - object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 - any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 - any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py deleted file mode 100644 index 7c1a8426712f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py +++ /dev/null @@ -1,277 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Whale(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - 'has_baleen': (bool,), # noqa: E501 - 'has_teeth': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'has_baleen': 'hasBaleen', # noqa: E501 - 'has_teeth': 'hasTeeth', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Whale - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Whale - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py deleted file mode 100644 index b6d2fe934d52..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py +++ /dev/null @@ -1,278 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class Zebra(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'PLAINS': "plains", - 'MOUNTAIN': "mountain", - 'GREVYS': "grevys", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Zebra - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Zebra - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _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) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py deleted file mode 100644 index ab2d0087dfa0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py +++ /dev/null @@ -1,2058 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from petstore_api.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - 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 variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - 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 variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - 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 variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - 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: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - 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( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py deleted file mode 100644 index 4be9629a182c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py +++ /dev/null @@ -1,111 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from petstore_api.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums -from petstore_api.model.address import Address -from petstore_api.model.animal import Animal -from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.api_response import ApiResponse -from petstore_api.model.apple import Apple -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.model.array_of_enums import ArrayOfEnums -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly -from petstore_api.model.array_test import ArrayTest -from petstore_api.model.banana import Banana -from petstore_api.model.banana_req import BananaReq -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.boolean_enum import BooleanEnum -from petstore_api.model.capitalization import Capitalization -from petstore_api.model.cat import Cat -from petstore_api.model.cat_all_of import CatAllOf -from petstore_api.model.category import Category -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.child_cat_all_of import ChildCatAllOf -from petstore_api.model.class_model import ClassModel -from petstore_api.model.client import Client -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations -from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps -from petstore_api.model.danish_pig import DanishPig -from petstore_api.model.dog import Dog -from petstore_api.model.dog_all_of import DogAllOf -from petstore_api.model.drawing import Drawing -from petstore_api.model.egress_threshold_options import EgressThresholdOptions -from petstore_api.model.enum_arrays import EnumArrays -from petstore_api.model.enum_class import EnumClass -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.file import File -from petstore_api.model.file_schema_test_class import FileSchemaTestClass -from petstore_api.model.foo import Foo -from petstore_api.model.foo_get_default_response import FooGetDefaultResponse -from petstore_api.model.foo_object import FooObject -from petstore_api.model.format_test import FormatTest -from petstore_api.model.fruit import Fruit -from petstore_api.model.fruit_req import FruitReq -from petstore_api.model.gm_fruit import GmFruit -from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties -from petstore_api.model.grandparent_animal import GrandparentAnimal -from petstore_api.model.has_only_read_only import HasOnlyReadOnly -from petstore_api.model.health_check_result import HealthCheckResult -from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.legs import Legs -from petstore_api.model.list import List -from petstore_api.model.mammal import Mammal -from petstore_api.model.map_test import MapTest -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.model.model200_response import Model200Response -from petstore_api.model.model_return import ModelReturn -from petstore_api.model.mole import Mole -from petstore_api.model.name import Name -from petstore_api.model.nullable_class import NullableClass -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.number_only import NumberOnly -from petstore_api.model.number_with_validations import NumberWithValidations -from petstore_api.model.object_interface import ObjectInterface -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.object_with_validations import ObjectWithValidations -from petstore_api.model.order import Order -from petstore_api.model.parent_pet import ParentPet -from petstore_api.model.pet import Pet -from petstore_api.model.pig import Pig -from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest -from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner -from petstore_api.model.publish_options import PublishOptions -from petstore_api.model.publish_options_publish import PublishOptionsPublish -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface -from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api.model.readonly import Readonly -from petstore_api.model.scalene_triangle import ScaleneTriangle -from petstore_api.model.shape import Shape -from petstore_api.model.shape_interface import ShapeInterface -from petstore_api.model.shape_or_null import ShapeOrNull -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral -from petstore_api.model.some_object import SomeObject -from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr -from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.stream_options import StreamOptions -from petstore_api.model.string_boolean_map import StringBooleanMap -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -from petstore_api.model.tag import Tag -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_interface import TriangleInterface -from petstore_api.model.user import User -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py b/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py deleted file mode 100644 index b66d8497bad2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import io -import json -import logging -import re -import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment -import urllib3 -import ipaddress - -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/signing.py b/samples/openapi3/client/petstore/python-prior/petstore_api/signing.py deleted file mode 100644 index 4ea7d8f779eb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/petstore_api/signing.py +++ /dev/null @@ -1,416 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from base64 import b64encode -from Crypto.IO import PEM, PKCS8 -from Crypto.Hash import SHA256, SHA512 -from Crypto.PublicKey import RSA, ECC -from Crypto.Signature import PKCS1_v1_5, pss, DSS -from email.utils import formatdate -import json -import os -import re -from time import time -from urllib.parse import urlencode, urlparse - -# The constants below define a subset of HTTP headers that can be included in the -# HTTP signature scheme. Additional headers may be included in the signature. - -# The '(request-target)' header is a calculated field that includes the HTTP verb, -# the URL path and the URL query. -HEADER_REQUEST_TARGET = '(request-target)' -# The time when the HTTP signature was generated. -HEADER_CREATED = '(created)' -# The time when the HTTP signature expires. The API server should reject HTTP requests -# that have expired. -HEADER_EXPIRES = '(expires)' -# The 'Host' header. -HEADER_HOST = 'Host' -# The 'Date' header. -HEADER_DATE = 'Date' -# When the 'Digest' header is included in the HTTP signature, the client automatically -# computes the digest of the HTTP request body, per RFC 3230. -HEADER_DIGEST = 'Digest' -# The 'Authorization' header is automatically generated by the client. It includes -# the list of signed headers and a base64-encoded signature. -HEADER_AUTHORIZATION = 'Authorization' - -# The constants below define the cryptographic schemes for the HTTP signature scheme. -SCHEME_HS2019 = 'hs2019' -SCHEME_RSA_SHA256 = 'rsa-sha256' -SCHEME_RSA_SHA512 = 'rsa-sha512' - -# The constants below define the signature algorithms that can be used for the HTTP -# signature scheme. -ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' -ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' - -ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' -ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' -ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { - ALGORITHM_ECDSA_MODE_FIPS_186_3, - ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 -} - -# The cryptographic hash algorithm for the message signature. -HASH_SHA256 = 'sha256' -HASH_SHA512 = 'sha512' - - -class HttpSigningConfiguration(object): - """The configuration parameters for the HTTP signature security scheme. - The HTTP signature security scheme is used to sign HTTP requests with a private key - which is in possession of the API client. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key. The 'Authorization' header is added to outbound HTTP requests. - - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param key_id: A string value specifying the identifier of the cryptographic key, - when signing HTTP requests. - :param signing_scheme: A string value specifying the signature scheme, when - signing HTTP requests. - Supported value are hs2019, rsa-sha256, rsa-sha512. - Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are - available for server-side applications that only support the older - HTTP signature algorithms. - :param private_key_path: A string value specifying the path of the file containing - a private key. The private key is used to sign HTTP requests. - :param private_key_passphrase: A string value specifying the passphrase to decrypt - the private key. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. - :param signing_algorithm: A string value specifying the signature algorithm, when - signing HTTP requests. - Supported values are: - 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. - 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. - If None, the signing algorithm is inferred from the private key. - The default signing algorithm for RSA keys is RSASSA-PSS. - The default signing algorithm for ECDSA keys is fips-186-3. - :param hash_algorithm: The hash algorithm for the signature. Supported values are - sha256 and sha512. - If the signing_scheme is rsa-sha256, the hash algorithm must be set - to None or sha256. - If the signing_scheme is rsa-sha512, the hash algorithm must be set - to None or sha512. - :param signature_max_validity: The signature max validity, expressed as - a datetime.timedelta value. It must be a positive value. - """ - def __init__(self, key_id, signing_scheme, private_key_path, - private_key_passphrase=None, - signed_headers=None, - signing_algorithm=None, - hash_algorithm=None, - signature_max_validity=None): - self.key_id = key_id - if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: - raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) - self.signing_scheme = signing_scheme - if not os.path.exists(private_key_path): - raise Exception("Private key file does not exist") - self.private_key_path = private_key_path - self.private_key_passphrase = private_key_passphrase - self.signing_algorithm = signing_algorithm - self.hash_algorithm = hash_algorithm - if signing_scheme == SCHEME_RSA_SHA256: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm != HASH_SHA256: - raise Exception("Hash algorithm must be sha256 when security scheme is %s" % - SCHEME_RSA_SHA256) - elif signing_scheme == SCHEME_RSA_SHA512: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA512 - elif self.hash_algorithm != HASH_SHA512: - raise Exception("Hash algorithm must be sha512 when security scheme is %s" % - SCHEME_RSA_SHA512) - elif signing_scheme == SCHEME_HS2019: - if self.hash_algorithm is None: - self.hash_algorithm = HASH_SHA256 - elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: - raise Exception("Invalid hash algorithm") - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - # If the user has not provided any signed_headers, the default must be set to '(created)', - # as specified in the 'HTTP signature' standard. - if signed_headers is None or len(signed_headers) == 0: - signed_headers = [HEADER_CREATED] - if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: - raise Exception( - "Signature max validity must be set when " - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - if HEADER_AUTHORIZATION in signed_headers: - raise Exception("'Authorization' header cannot be included in signed headers") - self.signed_headers = signed_headers - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ - self.host = None - """The host name, optionally followed by a colon and TCP port number. - """ - self._load_private_key() - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_list, request_headers_dict = self._get_signed_header_info( - resource_path, method, headers, body, query_params) - - header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) - b64_signed_msg = self._sign_digest(digest) - - request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( - signed_headers_list, b64_signed_msg) - - return request_headers_dict - - def get_public_key(self): - """Returns the public key object associated with the private key. - """ - pubkey = None - if isinstance(self.private_key, RSA.RsaKey): - pubkey = self.private_key.publickey() - elif isinstance(self.private_key, ECC.EccKey): - pubkey = self.private_key.public_key() - return pubkey - - def _load_private_key(self): - """Load the private key used to sign HTTP requests. - The private key is used to sign HTTP requests as defined in - https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. - """ - if self.private_key is not None: - return - with open(self.private_key_path, 'r') as f: - pem_data = f.read() - # Verify PEM Pre-Encapsulation Boundary - r = re.compile(r"\s*-----BEGIN (.*)-----\s+") - m = r.match(pem_data) - if not m: - raise ValueError("Not a valid PEM pre boundary") - pem_header = m.group(1) - if pem_header == 'RSA PRIVATE KEY': - self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) - elif pem_header == 'EC PRIVATE KEY': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: - # Key is in PKCS8 format, which is capable of holding many different - # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = \ - PEM.decode(pem_data, self.private_key_passphrase) - (oid, privkey, params) = \ - PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) - if oid == '1.2.840.10045.2.1': - self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) - else: - raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) - else: - raise Exception("Unsupported key: {0}".format(pem_header)) - # Validate the specified signature algorithm is compatible with the private key. - if self.signing_algorithm is not None: - supported_algs = None - if isinstance(self.private_key, RSA.RsaKey): - supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} - elif isinstance(self.private_key, ECC.EccKey): - supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS - if supported_algs is not None and self.signing_algorithm not in supported_algs: - raise Exception( - "Signing algorithm {0} is not compatible with private key".format( - self.signing_algorithm)) - - def _get_signed_header_info(self, resource_path, method, headers, body, query_params): - """Build the HTTP headers (name, value) that need to be included in - the HTTP signature scheme. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The object (e.g. a dict) representing the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate - the HTTP signature. - The second dict contains the HTTP headers that must be added to - the outbound HTTP request. - """ - - if body is None: - body = '' - else: - body = json.dumps(body) - - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(self.host).netloc - target_path = urlparse(self.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - request_target += "?" + urlencode(query_params) - - # Get UNIX time, e.g. seconds since epoch, not including leap seconds. - now = time() - # Format date per RFC 7231 section-7.1.1.2. An example is: - # Date: Wed, 21 Oct 2015 07:28:00 GMT - cdate = formatdate(timeval=now, localtime=False, usegmt=True) - # The '(created)' value MUST be a Unix timestamp integer value. - # Subsecond precision is not supported. - created = int(now) - if self.signature_max_validity is not None: - expires = now + self.signature_max_validity.total_seconds() - - signed_headers_list = [] - request_headers_dict = {} - for hdr_key in self.signed_headers: - hdr_key = hdr_key.lower() - if hdr_key == HEADER_REQUEST_TARGET: - value = request_target - elif hdr_key == HEADER_CREATED: - value = '{0}'.format(created) - elif hdr_key == HEADER_EXPIRES: - value = '{0}'.format(expires) - elif hdr_key == HEADER_DATE.lower(): - value = cdate - request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) - elif hdr_key == HEADER_DIGEST.lower(): - request_body = body.encode() - body_digest, digest_prefix = self._get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( - digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == HEADER_HOST.lower(): - value = target_host - request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) - else: - value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) - if value is None: - raise Exception( - "Cannot sign HTTP request. " - "Request does not contain the '{0}' header".format(hdr_key)) - signed_headers_list.append((hdr_key, value)) - - return signed_headers_list, request_headers_dict - - def _get_message_digest(self, data): - """Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of - the HTTP request. - The prefix is a string that identifies the cryptographic hash. It is used - to generate the 'Digest' header as specified in RFC 3230. - """ - if self.hash_algorithm == HASH_SHA512: - digest = SHA512.new() - prefix = 'SHA-512=' - elif self.hash_algorithm == HASH_SHA256: - digest = SHA256.new() - prefix = 'SHA-256=' - else: - raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) - digest.update(data) - return digest, prefix - - def _sign_digest(self, digest): - """Signs a message digest with a private key specified in the signing_info. - - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - sig_alg = self.signing_algorithm - if isinstance(self.private_key, RSA.RsaKey): - if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(self.private_key).sign(digest) - elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(self.private_key).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - elif isinstance(self.private_key, ECC.EccKey): - if sig_alg is None: - sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 - if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: - # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. - # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 - signature = DSS.new(key=self.private_key, mode=sig_alg, - encoding='der').sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) - else: - raise Exception("Unsupported private key: {0}".format(type(self.private_key))) - return b64encode(signature) - - def _get_authorization_header(self, signed_headers, signed_msg): - """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of tuples. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ - created_ts = None - expires_ts = None - for k, v in signed_headers: - if k == HEADER_CREATED: - created_ts = v - elif k == HEADER_EXPIRES: - expires_ts = v - lower_keys = [k.lower() for k, v in signed_headers] - headers_value = " ".join(lower_keys) - - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( - self.key_id, self.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( - headers_value, signed_msg.decode('ascii')) - - return auth_str diff --git a/samples/openapi3/client/petstore/python-prior/pom.xml b/samples/openapi3/client/petstore/python-prior/pom.xml deleted file mode 100644 index e7d7d9caf133..000000000000 --- a/samples/openapi3/client/petstore/python-prior/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PythonOAS3PetstoreTests - pom - 1.0-SNAPSHOT - Python OpenAPI3 Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/python-prior/requirements.txt b/samples/openapi3/client/petstore/python-prior/requirements.txt deleted file mode 100644 index 96947f60408f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 diff --git a/samples/openapi3/client/petstore/python-prior/setup.cfg b/samples/openapi3/client/petstore/python-prior/setup.cfg deleted file mode 100644 index 11433ee875ab..000000000000 --- a/samples/openapi3/client/petstore/python-prior/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-prior/setup.py b/samples/openapi3/client/petstore/python-prior/setup.py deleted file mode 100644 index 0fdf98480629..000000000000 --- a/samples/openapi3/client/petstore/python-prior/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", - "pem>=19.3.0", - "pycryptodome>=3.9.0", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.6", - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_description="""\ - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - """ -) diff --git a/samples/openapi3/client/petstore/python-prior/test-requirements.txt b/samples/openapi3/client/petstore/python-prior/test-requirements.txt deleted file mode 100644 index 4b3736d983e6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest-cov>=2.8.1 -pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python-prior/test/__init__.py b/samples/openapi3/client/petstore/python-prior/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py deleted file mode 100644 index 42fdf1948736..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.additional_properties_class import AdditionalPropertiesClass - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py deleted file mode 100644 index fc47f87b365d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_class import EnumClass -globals()['EnumClass'] = EnumClass -from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums - - -class TestAdditionalPropertiesWithArrayOfEnums(unittest.TestCase): - """AdditionalPropertiesWithArrayOfEnums unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesWithArrayOfEnums(self): - """Test AdditionalPropertiesWithArrayOfEnums""" - # FIXME: construct object with mandatory attributes with example values - # model = AdditionalPropertiesWithArrayOfEnums() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_address.py b/samples/openapi3/client/petstore/python-prior/test/test_address.py deleted file mode 100644 index 7afbdc4cd495..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_address.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.address import Address - - -class TestAddress(unittest.TestCase): - """Address unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAddress(self): - """Test Address""" - # FIXME: construct object with mandatory attributes with example values - # model = Address() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_animal.py b/samples/openapi3/client/petstore/python-prior/test/test_animal.py deleted file mode 100644 index a35e4c3469e4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_animal.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.cat import Cat -from petstore_api.model.dog import Dog -globals()['Cat'] = Cat -globals()['Dog'] = Dog -from petstore_api.model.animal import Animal - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py deleted file mode 100644 index c91e9a0585a3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.animal import Animal -globals()['Animal'] = Animal -from petstore_api.model.animal_farm import AnimalFarm - - -class TestAnimalFarm(unittest.TestCase): - """AnimalFarm unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimalFarm(self): - """Test AnimalFarm""" - # FIXME: construct object with mandatory attributes with example values - # model = AnimalFarm() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py deleted file mode 100644 index c58dfa6202bc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_call_123_test_special_tags(self): - """Test case for call_123_test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_api_response.py b/samples/openapi3/client/petstore/python-prior/test/test_api_response.py deleted file mode 100644 index a9a900c29cfa..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_api_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.api_response import ApiResponse - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_apple.py b/samples/openapi3/client/petstore/python-prior/test/test_apple.py deleted file mode 100644 index d26e07541671..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_apple.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple import Apple - - -class TestApple(unittest.TestCase): - """Apple unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApple(self): - """Test Apple""" - # FIXME: construct object with mandatory attributes with example values - # model = Apple() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_apple_req.py b/samples/openapi3/client/petstore/python-prior/test/test_apple_req.py deleted file mode 100644 index e4cc66efc2f7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_apple_req.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple_req import AppleReq - - -class TestAppleReq(unittest.TestCase): - """AppleReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAppleReq(self): - """Test AppleReq""" - # FIXME: construct object with mandatory attributes with example values - # model = AppleReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py deleted file mode 100644 index 39f8874a4e81..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py deleted file mode 100644 index c33f7189035b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum -globals()['StringEnum'] = StringEnum -from petstore_api.model.array_of_enums import ArrayOfEnums - - -class TestArrayOfEnums(unittest.TestCase): - """ArrayOfEnums unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfEnums(self): - """Test ArrayOfEnums""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfEnums() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py deleted file mode 100644 index c4abfd068614..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.array_of_number_only import ArrayOfNumberOnly - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_array_test.py b/samples/openapi3/client/petstore/python-prior/test/test_array_test.py deleted file mode 100644 index 19042d9c461d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_array_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.read_only_first import ReadOnlyFirst -globals()['ReadOnlyFirst'] = ReadOnlyFirst -from petstore_api.model.array_test import ArrayTest - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_banana.py b/samples/openapi3/client/petstore/python-prior/test/test_banana.py deleted file mode 100644 index 69b7704bc214..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_banana.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.banana import Banana - - -class TestBanana(unittest.TestCase): - """Banana unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBanana(self): - """Test Banana""" - # FIXME: construct object with mandatory attributes with example values - # model = Banana() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_banana_req.py b/samples/openapi3/client/petstore/python-prior/test/test_banana_req.py deleted file mode 100644 index 2f1d5a8ae3ad..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_banana_req.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.banana_req import BananaReq - - -class TestBananaReq(unittest.TestCase): - """BananaReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBananaReq(self): - """Test BananaReq""" - # FIXME: construct object with mandatory attributes with example values - # model = BananaReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py deleted file mode 100644 index 897a69bb81dd..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.basque_pig import BasquePig - - -class TestBasquePig(unittest.TestCase): - """BasquePig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBasquePig(self): - """Test BasquePig""" - # FIXME: construct object with mandatory attributes with example values - # model = BasquePig() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py deleted file mode 100644 index 61fe4b6c36d0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.boolean_enum import BooleanEnum - - -class TestBooleanEnum(unittest.TestCase): - """BooleanEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBooleanEnum(self): - """Test BooleanEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = BooleanEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_capitalization.py b/samples/openapi3/client/petstore/python-prior/test/test_capitalization.py deleted file mode 100644 index 5f47ddb4db09..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_capitalization.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.capitalization import Capitalization - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_cat.py b/samples/openapi3/client/petstore/python-prior/test/test_cat.py deleted file mode 100644 index 9008ab8f9a92..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_cat.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.address import Address -from petstore_api.model.animal import Animal -from petstore_api.model.cat_all_of import CatAllOf -globals()['Address'] = Address -globals()['Animal'] = Animal -globals()['CatAllOf'] = CatAllOf -from petstore_api.model.cat import Cat - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py deleted file mode 100644 index 3d5a33d9907b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.cat_all_of import CatAllOf - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_category.py b/samples/openapi3/client/petstore/python-prior/test/test_category.py deleted file mode 100644 index 29490e0dbdb1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_category.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.category import Category - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_child_cat.py b/samples/openapi3/client/petstore/python-prior/test/test_child_cat.py deleted file mode 100644 index 4fd3c6d254c4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_child_cat.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat_all_of import ChildCatAllOf -from petstore_api.model.parent_pet import ParentPet -globals()['ChildCatAllOf'] = ChildCatAllOf -globals()['ParentPet'] = ParentPet -from petstore_api.model.child_cat import ChildCat - - -class TestChildCat(unittest.TestCase): - """ChildCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCat(self): - """Test ChildCat""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py deleted file mode 100644 index 2a0b6b8c220c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat_all_of import ChildCatAllOf - - -class TestChildCatAllOf(unittest.TestCase): - """ChildCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChildCatAllOf(self): - """Test ChildCatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = ChildCatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_class_model.py b/samples/openapi3/client/petstore/python-prior/test/test_class_model.py deleted file mode 100644 index 6dc2a6928321..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_class_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.class_model import ClassModel - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_client.py b/samples/openapi3/client/petstore/python-prior/test/test_client.py deleted file mode 100644 index caf85a24aa27..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_client.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.client import Client - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py deleted file mode 100644 index 20f367840e10..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface -from petstore_api.model.shape_interface import ShapeInterface -globals()['QuadrilateralInterface'] = QuadrilateralInterface -globals()['ShapeInterface'] = ShapeInterface -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral - - -class TestComplexQuadrilateral(unittest.TestCase): - """ComplexQuadrilateral unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testComplexQuadrilateral(self): - """Test ComplexQuadrilateral""" - # FIXME: construct object with mandatory attributes with example values - # model = ComplexQuadrilateral() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py deleted file mode 100644 index 1d19b30d508d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.animal import Animal -from petstore_api.model.number_with_validations import NumberWithValidations -globals()['Animal'] = Animal -globals()['NumberWithValidations'] = NumberWithValidations -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations - - -class TestComposedOneOfNumberWithValidations(unittest.TestCase): - """ComposedOneOfNumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testComposedOneOfNumberWithValidations(self): - """Test ComposedOneOfNumberWithValidations""" - # FIXME: construct object with mandatory attributes with example values - # model = ComposedOneOfNumberWithValidations() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py deleted file mode 100644 index 7e7ac901ca6d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag -globals()['Tag'] = Tag -from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps - - -class TestComposedSchemaWithPropsAndNoAddProps(unittest.TestCase): - """ComposedSchemaWithPropsAndNoAddProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testComposedSchemaWithPropsAndNoAddProps(self): - """Test ComposedSchemaWithPropsAndNoAddProps""" - # FIXME: construct object with mandatory attributes with example values - # model = ComposedSchemaWithPropsAndNoAddProps() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py deleted file mode 100644 index dadbf7f6617c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.danish_pig import DanishPig - - -class TestDanishPig(unittest.TestCase): - """DanishPig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDanishPig(self): - """Test DanishPig""" - # FIXME: construct object with mandatory attributes with example values - # model = DanishPig() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_default_api.py b/samples/openapi3/client/petstore/python-prior/test/test_default_api.py deleted file mode 100644 index caf174d6d4ba..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_default_api.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.default_api import DefaultApi # noqa: E501 - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self): - self.api = DefaultApi() # noqa: E501 - - def tearDown(self): - pass - - def test_foo_get(self): - """Test case for foo_get - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_dog.py b/samples/openapi3/client/petstore/python-prior/test/test_dog.py deleted file mode 100644 index cfd84be56688..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_dog.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.animal import Animal -from petstore_api.model.dog_all_of import DogAllOf -globals()['Animal'] = Animal -globals()['DogAllOf'] = DogAllOf -from petstore_api.model.dog import Dog - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # FIXME: construct object with mandatory attributes with example values - # model = Dog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py deleted file mode 100644 index 9f5075b7ed71..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.dog_all_of import DogAllOf - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_drawing.py b/samples/openapi3/client/petstore/python-prior/test/test_drawing.py deleted file mode 100644 index 9148df075d06..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_drawing.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.fruit import Fruit -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.shape import Shape -from petstore_api.model.shape_or_null import ShapeOrNull -globals()['Fruit'] = Fruit -globals()['NullableShape'] = NullableShape -globals()['Shape'] = Shape -globals()['ShapeOrNull'] = ShapeOrNull -from petstore_api.model.drawing import Drawing - - -class TestDrawing(unittest.TestCase): - """Drawing unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDrawing(self): - """Test Drawing""" - # FIXME: construct object with mandatory attributes with example values - # model = Drawing() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py b/samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py deleted file mode 100644 index 04c4c46142f8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.egress_threshold_options import EgressThresholdOptions - - -class TestEgressThresholdOptions(unittest.TestCase): - """EgressThresholdOptions unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEgressThresholdOptions(self): - """Test EgressThresholdOptions""" - # FIXME: construct object with mandatory attributes with example values - # model = EgressThresholdOptions() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py deleted file mode 100644 index 9458d918a604..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_arrays import EnumArrays - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumArrays() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_enum_class.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_class.py deleted file mode 100644 index ed19c7985d4e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_enum_class.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_class import EnumClass - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_enum_test.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_test.py deleted file mode 100644 index 7b0599f5a987..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_enum_test.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -globals()['IntegerEnum'] = IntegerEnum -globals()['IntegerEnumOneValue'] = IntegerEnumOneValue -globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue -globals()['StringEnum'] = StringEnum -globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue -from petstore_api.model.enum_test import EnumTest - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py deleted file mode 100644 index 1f371b359306..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape_interface import ShapeInterface -from petstore_api.model.triangle_interface import TriangleInterface -globals()['ShapeInterface'] = ShapeInterface -globals()['TriangleInterface'] = TriangleInterface -from petstore_api.model.equilateral_triangle import EquilateralTriangle - - -class TestEquilateralTriangle(unittest.TestCase): - """EquilateralTriangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEquilateralTriangle(self): - """Test EquilateralTriangle""" - # FIXME: construct object with mandatory attributes with example values - # model = EquilateralTriangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fake_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_api.py deleted file mode 100644 index cef101949bd6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fake_api.py +++ /dev/null @@ -1,210 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_additional_properties_with_array_of_enums(self): - """Test case for additional_properties_with_array_of_enums - - Additional Properties with Array of Enums # noqa: E501 - """ - pass - - def test_array_model(self): - """Test case for array_model - - """ - pass - - def test_array_of_enums(self): - """Test case for array_of_enums - - Array of Enums # noqa: E501 - """ - pass - - def test_boolean(self): - """Test case for boolean - - """ - pass - - def test_composed_one_of_number_with_validations(self): - """Test case for composed_one_of_number_with_validations - - """ - pass - - def test_download_attachment(self): - """Test case for download_attachment - - downloads a file using Content-Disposition # noqa: E501 - """ - pass - - def test_enum_test(self): - """Test case for enum_test - - Object contains enum properties and array properties containing enums # noqa: E501 - """ - pass - - def test_fake_health_get(self): - """Test case for fake_health_get - - Health check endpoint # noqa: E501 - """ - pass - - def test_mammal(self): - """Test case for mammal - - """ - pass - - def test_number_with_validations(self): - """Test case for number_with_validations - - """ - pass - - def test_object_model_with_ref_props(self): - """Test case for object_model_with_ref_props - - """ - pass - - def test_post_inline_additional_properties_payload(self): - """Test case for post_inline_additional_properties_payload - - """ - pass - - def test_post_inline_additional_properties_ref_payload(self): - """Test case for post_inline_additional_properties_ref_payload - - """ - pass - - def test_string(self): - """Test case for string - - """ - pass - - def test_string_enum(self): - """Test case for string_enum - - """ - pass - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - def test_test_query_parameter_collection_format(self): - """Test case for test_query_parameter_collection_format - - """ - pass - - def test_tx_rx_any_of_model(self): - """Test case for tx_rx_any_of_model - - """ - pass - - def test_upload_download_file(self): - """Test case for upload_download_file - - uploads a file and downloads a file using application/octet-stream # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads a file using multipart/form-data # noqa: E501 - """ - pass - - def test_upload_files(self): - """Test case for upload_files - - uploads files using multipart/form-data # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py deleted file mode 100644 index cf77b62fab70..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index b7724aaed7d1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py deleted file mode 100644 index 6b4be44e865d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData - - -class TestFakePostInlineAdditionalPropertiesPayloadArrayData(unittest.TestCase): - """FakePostInlineAdditionalPropertiesPayloadArrayData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFakePostInlineAdditionalPropertiesPayloadArrayData(self): - """Test FakePostInlineAdditionalPropertiesPayloadArrayData""" - # FIXME: construct object with mandatory attributes with example values - # model = FakePostInlineAdditionalPropertiesPayloadArrayData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_file.py b/samples/openapi3/client/petstore/python-prior/test/test_file.py deleted file mode 100644 index 438482f39525..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_file.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.file import File - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py deleted file mode 100644 index 6366cd33470c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.file import File -globals()['File'] = File -from petstore_api.model.file_schema_test_class import FileSchemaTestClass - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_foo.py b/samples/openapi3/client/petstore/python-prior/test/test_foo.py deleted file mode 100644 index 648a84c66f7c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_foo.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.foo import Foo - - -class TestFoo(unittest.TestCase): - """Foo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFoo(self): - """Test Foo""" - # FIXME: construct object with mandatory attributes with example values - # model = Foo() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py deleted file mode 100644 index 8a3769551c93..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.foo import Foo -globals()['Foo'] = Foo -from petstore_api.model.foo_get_default_response import FooGetDefaultResponse - - -class TestFooGetDefaultResponse(unittest.TestCase): - """FooGetDefaultResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFooGetDefaultResponse(self): - """Test FooGetDefaultResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = FooGetDefaultResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_foo_object.py b/samples/openapi3/client/petstore/python-prior/test/test_foo_object.py deleted file mode 100644 index 9e04e6ddf7ab..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_foo_object.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.foo_object import FooObject - - -class TestFooObject(unittest.TestCase): - """FooObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFooObject(self): - """Test FooObject""" - # FIXME: construct object with mandatory attributes with example values - # model = FooObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_format_test.py b/samples/openapi3/client/petstore/python-prior/test/test_format_test.py deleted file mode 100644 index a5441cec1c97..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_format_test.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.format_test import FormatTest - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFormatTest(self): - """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = FormatTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fruit.py b/samples/openapi3/client/petstore/python-prior/test/test_fruit.py deleted file mode 100644 index 6527951571c9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fruit.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana -globals()['Apple'] = Apple -globals()['Banana'] = Banana -from petstore_api.model.fruit import Fruit - - -class TestFruit(unittest.TestCase): - """Fruit unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFruit(self): - """Test Fruit""" - # FIXME: construct object with mandatory attributes with example values - # model = Fruit() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py deleted file mode 100644 index 8e6bebb0b5e2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.banana_req import BananaReq -globals()['AppleReq'] = AppleReq -globals()['BananaReq'] = BananaReq -from petstore_api.model.fruit_req import FruitReq - - -class TestFruitReq(unittest.TestCase): - """FruitReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFruitReq(self): - """Test FruitReq""" - # FIXME: construct object with mandatory attributes with example values - # model = FruitReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py deleted file mode 100644 index bae41bb7555e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana -globals()['Apple'] = Apple -globals()['Banana'] = Banana -from petstore_api.model.gm_fruit import GmFruit - - -class TestGmFruit(unittest.TestCase): - """GmFruit unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGmFruit(self): - """Test GmFruit""" - # FIXME: construct object with mandatory attributes with example values - # model = GmFruit() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py b/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py deleted file mode 100644 index 6307028c07c2..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana -globals()['Apple'] = Apple -globals()['Banana'] = Banana -from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties - - -class TestGmFruitNoProperties(unittest.TestCase): - """GmFruitNoProperties unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGmFruitNoProperties(self): - """Test GmFruitNoProperties""" - # FIXME: construct object with mandatory attributes with example values - # model = GmFruitNoProperties() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py deleted file mode 100644 index 9c84811bd801..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.parent_pet import ParentPet -globals()['ChildCat'] = ChildCat -globals()['ParentPet'] = ParentPet -from petstore_api.model.grandparent_animal import GrandparentAnimal - - -class TestGrandparentAnimal(unittest.TestCase): - """GrandparentAnimal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGrandparentAnimal(self): - """Test GrandparentAnimal""" - # FIXME: construct object with mandatory attributes with example values - # model = GrandparentAnimal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py deleted file mode 100644 index c9bf4c28658a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.has_only_read_only import HasOnlyReadOnly - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py deleted file mode 100644 index 35f4d3afa989..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.health_check_result import HealthCheckResult - - -class TestHealthCheckResult(unittest.TestCase): - """HealthCheckResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHealthCheckResult(self): - """Test HealthCheckResult""" - # FIXME: construct object with mandatory attributes with example values - # model = HealthCheckResult() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py deleted file mode 100644 index 7e8cf543335f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData -globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData -from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload - - -class TestInlineAdditionalPropertiesRefPayload(unittest.TestCase): - """InlineAdditionalPropertiesRefPayload unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineAdditionalPropertiesRefPayload(self): - """Test InlineAdditionalPropertiesRefPayload""" - # FIXME: construct object with mandatory attributes with example values - # model = InlineAdditionalPropertiesRefPayload() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py deleted file mode 100644 index 887e5689b9ad..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData -globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData -from petstore_api.model.inline_object6 import InlineObject6 - - -class TestInlineObject6(unittest.TestCase): - """InlineObject6 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject6(self): - """Test InlineObject6""" - # FIXME: construct object with mandatory attributes with example values - # model = InlineObject6() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py deleted file mode 100644 index 3b3fc2ddcdf7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.foo import Foo -globals()['Foo'] = Foo -from petstore_api.model.inline_response_default import InlineResponseDefault - - -class TestInlineResponseDefault(unittest.TestCase): - """InlineResponseDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponseDefault(self): - """Test InlineResponseDefault""" - # FIXME: construct object with mandatory attributes with example values - # model = InlineResponseDefault() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py deleted file mode 100644 index 34a2dada3914..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum import IntegerEnum - - -class TestIntegerEnum(unittest.TestCase): - """IntegerEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIntegerEnum(self): - """Test IntegerEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = IntegerEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py deleted file mode 100644 index 0f5c3bef7b9d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue - - -class TestIntegerEnumOneValue(unittest.TestCase): - """IntegerEnumOneValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIntegerEnumOneValue(self): - """Test IntegerEnumOneValue""" - # FIXME: construct object with mandatory attributes with example values - # model = IntegerEnumOneValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py deleted file mode 100644 index e75255319547..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue - - -class TestIntegerEnumWithDefaultValue(unittest.TestCase): - """IntegerEnumWithDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIntegerEnumWithDefaultValue(self): - """Test IntegerEnumWithDefaultValue""" - # FIXME: construct object with mandatory attributes with example values - # model = IntegerEnumWithDefaultValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py deleted file mode 100644 index a426514a5ee9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape_interface import ShapeInterface -from petstore_api.model.triangle_interface import TriangleInterface -globals()['ShapeInterface'] = ShapeInterface -globals()['TriangleInterface'] = TriangleInterface -from petstore_api.model.isosceles_triangle import IsoscelesTriangle - - -class TestIsoscelesTriangle(unittest.TestCase): - """IsoscelesTriangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIsoscelesTriangle(self): - """Test IsoscelesTriangle""" - # FIXME: construct object with mandatory attributes with example values - # model = IsoscelesTriangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_legs.py b/samples/openapi3/client/petstore/python-prior/test/test_legs.py deleted file mode 100644 index 3244bdb7493f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_legs.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.legs import Legs - - -class TestLegs(unittest.TestCase): - """Legs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLegs(self): - """Test Legs""" - # FIXME: construct object with mandatory attributes with example values - # model = Legs() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_list.py b/samples/openapi3/client/petstore/python-prior/test/test_list.py deleted file mode 100644 index 77611c300dc8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_list.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.list import List - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_mammal.py b/samples/openapi3/client/petstore/python-prior/test/test_mammal.py deleted file mode 100644 index ee379a52a642..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_mammal.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.pig import Pig -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra -globals()['Pig'] = Pig -globals()['Whale'] = Whale -globals()['Zebra'] = Zebra -from petstore_api.model.mammal import Mammal - - -class TestMammal(unittest.TestCase): - """Mammal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMammal(self): - """Test Mammal""" - # FIXME: construct object with mandatory attributes with example values - # model = Mammal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_map_test.py b/samples/openapi3/client/petstore/python-prior/test/test_map_test.py deleted file mode 100644 index 9cddd802e56e..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_map_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_boolean_map import StringBooleanMap -globals()['StringBooleanMap'] = StringBooleanMap -from petstore_api.model.map_test import MapTest - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMapTest(self): - """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = MapTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 60b774977965..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.animal import Animal -globals()['Animal'] = Animal -from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_model200_response.py b/samples/openapi3/client/petstore/python-prior/test/test_model200_response.py deleted file mode 100644 index 8ff474d5dde3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_model200_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.model200_response import Model200Response - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py b/samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py deleted file mode 100644 index 5858658d2947..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.model_200_response import Model_200Response - - -class TestModel_200Response(unittest.TestCase): - """Model_200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel_200Response(self): - """Test Model_200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = Model_200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_model_return.py b/samples/openapi3/client/petstore/python-prior/test/test_model_return.py deleted file mode 100644 index f856d3d76206..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_model_return.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.model_return import ModelReturn - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_mole.py b/samples/openapi3/client/petstore/python-prior/test/test_mole.py deleted file mode 100644 index 176fdf03a314..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_mole.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.mole import Mole - - -class TestMole(unittest.TestCase): - """Mole unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMole(self): - """Test Mole""" - # FIXME: construct object with mandatory attributes with example values - # mole = Mole() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_name.py b/samples/openapi3/client/petstore/python-prior/test/test_name.py deleted file mode 100644 index b3841ca0304f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_name.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.name import Name - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py deleted file mode 100644 index 730e9264ef9d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.nullable_class import NullableClass - - -class TestNullableClass(unittest.TestCase): - """NullableClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNullableClass(self): - """Test NullableClass""" - # FIXME: construct object with mandatory attributes with example values - # model = NullableClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py deleted file mode 100644 index c78e2d09e141..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle -globals()['Quadrilateral'] = Quadrilateral -globals()['Triangle'] = Triangle -from petstore_api.model.nullable_shape import NullableShape - - -class TestNullableShape(unittest.TestCase): - """NullableShape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNullableShape(self): - """Test NullableShape""" - # FIXME: construct object with mandatory attributes with example values - # model = NullableShape() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_number_only.py deleted file mode 100644 index b7205f5fe029..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_number_only.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.number_only import NumberOnly - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py deleted file mode 100644 index 80c25c556f8d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations - - -class TestNumberWithValidations(unittest.TestCase): - """NumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberWithValidations(self): - """Test NumberWithValidations""" - # FIXME: construct object with mandatory attributes with example values - # model = NumberWithValidations() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_object_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_object_interface.py deleted file mode 100644 index a47478b5d2f1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_object_interface.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.object_interface import ObjectInterface - - -class TestObjectInterface(unittest.TestCase): - """ObjectInterface unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectInterface(self): - """Test ObjectInterface""" - # FIXME: construct object with mandatory attributes with example values - # model = ObjectInterface() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py deleted file mode 100644 index 95f082b66138..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations -globals()['NumberWithValidations'] = NumberWithValidations -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectModelWithRefProps(self): - """Test ObjectModelWithRefProps""" - # FIXME: construct object with mandatory attributes with example values - # model = ObjectModelWithRefProps() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py deleted file mode 100644 index 4f8cf0335c1a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.object_with_validations import ObjectWithValidations - - -class TestObjectWithValidations(unittest.TestCase): - """ObjectWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectWithValidations(self): - """Test ObjectWithValidations""" - # FIXME: construct object with mandatory attributes with example values - # model = ObjectWithValidations() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_order.py b/samples/openapi3/client/petstore/python-prior/test/test_order.py deleted file mode 100644 index fd420b846a74..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_order.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.order import Order - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = Order() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py b/samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py deleted file mode 100644 index dd35d7e7f4de..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.grandparent_animal import GrandparentAnimal -globals()['ChildCat'] = ChildCat -globals()['GrandparentAnimal'] = GrandparentAnimal -from petstore_api.model.parent_pet import ParentPet - - -class TestParentPet(unittest.TestCase): - """ParentPet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentPet(self): - """Test ParentPet""" - # FIXME: construct object with mandatory attributes with example values - # model = ParentPet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_pet.py b/samples/openapi3/client/petstore/python-prior/test/test_pet.py deleted file mode 100644 index 0d77e022738b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_pet.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.category import Category -from petstore_api.model.tag import Tag -globals()['Category'] = Category -globals()['Tag'] = Tag -from petstore_api.model.pet import Pet - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPet(self): - """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = Pet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_pet_api.py b/samples/openapi3/client/petstore/python-prior/test/test_pet_api.py deleted file mode 100644 index d545f497297a..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_pet_api.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - def test_upload_file_with_required_file(self): - """Test case for upload_file_with_required_file - - uploads an image (required) # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_pig.py deleted file mode 100644 index 0b2ffff147eb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_pig.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.danish_pig import DanishPig -globals()['BasquePig'] = BasquePig -globals()['DanishPig'] = DanishPig -from petstore_api.model.pig import Pig - - -class TestPig(unittest.TestCase): - """Pig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPig(self): - """Test Pig""" - # FIXME: construct object with mandatory attributes with example values - # model = Pig() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py deleted file mode 100644 index 649f7891af22..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner -globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner -from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest - - -class TestPostInlineAdditionalPropertiesPayloadRequest(unittest.TestCase): - """PostInlineAdditionalPropertiesPayloadRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPostInlineAdditionalPropertiesPayloadRequest(self): - """Test PostInlineAdditionalPropertiesPayloadRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = PostInlineAdditionalPropertiesPayloadRequest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py deleted file mode 100644 index 5a38f9ea5e57..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - - -class TestPostInlineAdditionalPropertiesPayloadRequestArrayDataInner(unittest.TestCase): - """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPostInlineAdditionalPropertiesPayloadRequestArrayDataInner(self): - """Test PostInlineAdditionalPropertiesPayloadRequestArrayDataInner""" - # FIXME: construct object with mandatory attributes with example values - # model = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_publish_options.py b/samples/openapi3/client/petstore/python-prior/test/test_publish_options.py deleted file mode 100644 index 819ff51bb7f4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_publish_options.py +++ /dev/null @@ -1,37 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.publish_options_publish import PublishOptionsPublish -globals()['PublishOptionsPublish'] = PublishOptionsPublish -from petstore_api.model.publish_options import PublishOptions - - -class TestPublishOptions(unittest.TestCase): - """PublishOptions unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPublishOptions(self): - """Test PublishOptions""" - # FIXME: construct object with mandatory attributes with example values - # model = PublishOptions() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py b/samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py deleted file mode 100644 index 1e848058661f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.publish_options_publish import PublishOptionsPublish - - -class TestPublishOptionsPublish(unittest.TestCase): - """PublishOptionsPublish unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPublishOptionsPublish(self): - """Test PublishOptionsPublish""" - # FIXME: construct object with mandatory attributes with example values - # model = PublishOptionsPublish() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py deleted file mode 100644 index 82c0c49d21d1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral -globals()['ComplexQuadrilateral'] = ComplexQuadrilateral -globals()['SimpleQuadrilateral'] = SimpleQuadrilateral -from petstore_api.model.quadrilateral import Quadrilateral - - -class TestQuadrilateral(unittest.TestCase): - """Quadrilateral unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testQuadrilateral(self): - """Test Quadrilateral""" - # FIXME: construct object with mandatory attributes with example values - # model = Quadrilateral() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py deleted file mode 100644 index 2dee368036f9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface - - -class TestQuadrilateralInterface(unittest.TestCase): - """QuadrilateralInterface unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testQuadrilateralInterface(self): - """Test QuadrilateralInterface""" - # FIXME: construct object with mandatory attributes with example values - # model = QuadrilateralInterface() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py deleted file mode 100644 index a07676e9c2de..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.read_only_first import ReadOnlyFirst - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_readonly.py b/samples/openapi3/client/petstore/python-prior/test/test_readonly.py deleted file mode 100644 index 50be60d4e446..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_readonly.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.readonly import Readonly - - -class TestReadonly(unittest.TestCase): - """Readonly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadonly(self): - """Test Readonly""" - # FIXME: construct object with mandatory attributes with example values - # model = Readonly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py deleted file mode 100644 index 2235c4969ac1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape_interface import ShapeInterface -from petstore_api.model.triangle_interface import TriangleInterface -globals()['ShapeInterface'] = ShapeInterface -globals()['TriangleInterface'] = TriangleInterface -from petstore_api.model.scalene_triangle import ScaleneTriangle - - -class TestScaleneTriangle(unittest.TestCase): - """ScaleneTriangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScaleneTriangle(self): - """Test ScaleneTriangle""" - # FIXME: construct object with mandatory attributes with example values - # model = ScaleneTriangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_shape.py b/samples/openapi3/client/petstore/python-prior/test/test_shape.py deleted file mode 100644 index 23612c3fc8a7..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_shape.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle -globals()['Quadrilateral'] = Quadrilateral -globals()['Triangle'] = Triangle -from petstore_api.model.shape import Shape - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testShape(self): - """Test Shape""" - # FIXME: construct object with mandatory attributes with example values - # model = Shape() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py deleted file mode 100644 index 9108ad867303..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.shape_interface import ShapeInterface - - -class TestShapeInterface(unittest.TestCase): - """ShapeInterface unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testShapeInterface(self): - """Test ShapeInterface""" - # FIXME: construct object with mandatory attributes with example values - # model = ShapeInterface() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py deleted file mode 100644 index dbe1db89c2eb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle -globals()['Quadrilateral'] = Quadrilateral -globals()['Triangle'] = Triangle -from petstore_api.model.shape_or_null import ShapeOrNull - - -class TestShapeOrNull(unittest.TestCase): - """ShapeOrNull unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testShapeOrNull(self): - """Test ShapeOrNull""" - # FIXME: construct object with mandatory attributes with example values - # model = ShapeOrNull() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py deleted file mode 100644 index b12cb4504d05..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface -from petstore_api.model.shape_interface import ShapeInterface -globals()['QuadrilateralInterface'] = QuadrilateralInterface -globals()['ShapeInterface'] = ShapeInterface -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral - - -class TestSimpleQuadrilateral(unittest.TestCase): - """SimpleQuadrilateral unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSimpleQuadrilateral(self): - """Test SimpleQuadrilateral""" - # FIXME: construct object with mandatory attributes with example values - # model = SimpleQuadrilateral() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_some_object.py b/samples/openapi3/client/petstore/python-prior/test/test_some_object.py deleted file mode 100644 index aa40d31cb881..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_some_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.object_interface import ObjectInterface -globals()['ObjectInterface'] = ObjectInterface -from petstore_api.model.some_object import SomeObject - - -class TestSomeObject(unittest.TestCase): - """SomeObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSomeObject(self): - """Test SomeObject""" - # FIXME: construct object with mandatory attributes with example values - # model = SomeObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py b/samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py deleted file mode 100644 index a41abbd1b015..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py +++ /dev/null @@ -1,35 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr - - -class TestSomeObjectWithSelfAttr(unittest.TestCase): - """SomeObjectWithSelfAttr unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSomeObjectWithSelfAttr(self): - """Test SomeObjectWithSelfAttr""" - kwargs = {"self": "this is a string", "_spec_property_naming": True} - model = SomeObjectWithSelfAttr(**kwargs) - assert model._self == "this is a string" - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py deleted file mode 100644 index 4c525d99be5b..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.special_model_name import SpecialModelName - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_store_api.py b/samples/openapi3/client/petstore/python-prior/test/test_store_api.py deleted file mode 100644 index 3680a34b42a0..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_store_api.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_stream_options.py b/samples/openapi3/client/petstore/python-prior/test/test_stream_options.py deleted file mode 100644 index 807e24596fff..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_stream_options.py +++ /dev/null @@ -1,41 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.egress_threshold_options import EgressThresholdOptions -from petstore_api.model.publish_options import PublishOptions -from petstore_api.model.publish_options_publish import PublishOptionsPublish -globals()['EgressThresholdOptions'] = EgressThresholdOptions -globals()['PublishOptions'] = PublishOptions -globals()['PublishOptionsPublish'] = PublishOptionsPublish -from petstore_api.model.stream_options import StreamOptions - - -class TestStreamOptions(unittest.TestCase): - """StreamOptions unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStreamOptions(self): - """Test StreamOptions""" - # FIXME: construct object with mandatory attributes with example values - # model = StreamOptions() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py deleted file mode 100644 index e4e795cca2a9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_boolean_map import StringBooleanMap - - -class TestStringBooleanMap(unittest.TestCase): - """StringBooleanMap unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringBooleanMap(self): - """Test StringBooleanMap""" - # FIXME: construct object with mandatory attributes with example values - # model = StringBooleanMap() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_string_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_string_enum.py deleted file mode 100644 index 7348ffdaa87d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_string_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum - - -class TestStringEnum(unittest.TestCase): - """StringEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringEnum(self): - """Test StringEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = StringEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py deleted file mode 100644 index 2a83ea5ba97d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue - - -class TestStringEnumWithDefaultValue(unittest.TestCase): - """StringEnumWithDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringEnumWithDefaultValue(self): - """Test StringEnumWithDefaultValue""" - # FIXME: construct object with mandatory attributes with example values - # model = StringEnumWithDefaultValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_tag.py b/samples/openapi3/client/petstore/python-prior/test/test_tag.py deleted file mode 100644 index 0ce1c0a87f1d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_tag.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_triangle.py deleted file mode 100644 index c62116c434f6..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_triangle.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle -globals()['EquilateralTriangle'] = EquilateralTriangle -globals()['IsoscelesTriangle'] = IsoscelesTriangle -globals()['ScaleneTriangle'] = ScaleneTriangle -from petstore_api.model.triangle import Triangle - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangle(self): - """Test Triangle""" - # FIXME: construct object with mandatory attributes with example values - # model = Triangle() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py deleted file mode 100644 index 6e88d29b7ca9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.triangle_interface import TriangleInterface - - -class TestTriangleInterface(unittest.TestCase): - """TriangleInterface unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangleInterface(self): - """Test TriangleInterface""" - # FIXME: construct object with mandatory attributes with example values - # model = TriangleInterface() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_user.py b/samples/openapi3/client/petstore/python-prior/test/test_user.py deleted file mode 100644 index df3d2fff6532..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_user.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.user import User - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_user_api.py b/samples/openapi3/client/petstore/python-prior/test/test_user_api.py deleted file mode 100644 index abf57b0733da..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_user_api.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_whale.py b/samples/openapi3/client/petstore/python-prior/test/test_whale.py deleted file mode 100644 index d057053203cc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_whale.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.whale import Whale - - -class TestWhale(unittest.TestCase): - """Whale unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testWhale(self): - """Test Whale""" - # FIXME: construct object with mandatory attributes with example values - # model = Whale() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test/test_zebra.py b/samples/openapi3/client/petstore/python-prior/test/test_zebra.py deleted file mode 100644 index affb41e5cb45..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test/test_zebra.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.zebra import Zebra - - -class TestZebra(unittest.TestCase): - """Zebra unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testZebra(self): - """Test Zebra""" - # FIXME: construct object with mandatory attributes with example values - # model = Zebra() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/test_python.sh b/samples/openapi3/client/petstore/python-prior/test_python.sh deleted file mode 100755 index f617f3adfa64..000000000000 --- a/samples/openapi3/client/petstore/python-prior/test_python.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi diff --git a/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic1.png b/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic1.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic2.png b/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic2.png deleted file mode 100644 index 7d3a386a21026f9b15b2c303a81f5c69333e9056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/__init__.py b/samples/openapi3/client/petstore/python-prior/tests_manual/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py deleted file mode 100644 index 906c271ae930..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py +++ /dev/null @@ -1,175 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - -import time -import atexit -import datetime -import functools -import json -import sys -import weakref -import unittest -from dateutil.parser import parse -from collections import namedtuple - -import petstore_api -from petstore_api.api import pet_api -from petstore_api.model import array_of_enums -from petstore_api.model import format_test -from petstore_api.model import string_enum -import petstore_api.configuration - -HOST = 'http://petstore.swagger.io/v2' -MockResponse = namedtuple('MockResponse', 'data') - - -class ApiClientTests(unittest.TestCase): - def setUp(self): - self.api_client = petstore_api.ApiClient() - - def test_configuration(self): - config = petstore_api.Configuration() - config.host = 'http://localhost/' - - config.disabled_client_side_validations = ("multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum," - "maxLength,minLength,pattern,maxItems,minItems") - with self.checkRaiseRegex(ValueError, "Invalid keyword: 'foo'"): - config.disabled_client_side_validations = 'foo' - config.disabled_client_side_validations = "" - - def test_servers(self): - config = petstore_api.Configuration(server_index=1, server_variables={'version': 'v1'}) - api_client = petstore_api.ApiClient(config) - api = pet_api.PetApi(api_client) - - def request(expected_url, method, url, **kwargs): - assert expected_url == url - raise RuntimeError('pass') - - api_client.request = functools.partial(request, 'http://path-server-test.petstore.local/v2/pet') - try: - api.add_pet({'name': 'pet', 'photo_urls': []}) - except RuntimeError as e: - assert "pass" == str(e) - - api_client.request = functools.partial(request, 'https://localhost:8080/v1/pet/123456789') - try: - api.delete_pet(123456789) - except RuntimeError as e: - assert "pass" == str(e) - - def test_array_of_enums(self): - data = [ - "placed", None - ] - response = MockResponse(data=json.dumps(data)) - deserialized = self.api_client.deserialize(response, (array_of_enums.ArrayOfEnums, ), True) - assert isinstance(deserialized, array_of_enums.ArrayOfEnums) - assert array_of_enums.ArrayOfEnums([string_enum.StringEnum(v) for v in data]) == deserialized - - def checkRaiseRegex(self, expected_exception, expected_regex): - if sys.version_info < (3, 0): - return self.assertRaisesRegexp(expected_exception, expected_regex) - - return self.assertRaisesRegex(expected_exception, expected_regex) - - - def test_multiple_of(self): - inst = format_test.FormatTest( - byte='3', - date=datetime.date(2000, 1, 1), - password="abcdefghijkl", - integer=30, - number=65.0, - float=62.4 - ) - assert isinstance(inst, format_test.FormatTest) - - with self.checkRaiseRegex(petstore_api.exceptions.ApiValueError, "Invalid value for `integer`, value must be a multiple of `2`"): - inst = format_test.FormatTest( - byte='3', - date=datetime.date(2000, 1, 1), - password="abcdefghijkl", - integer=31, # Value is supposed to be multiple of '2'. An error must be raised - number=65.0, - float=62.4 - ) - - def test_multiple_of_deserialization(self): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 30, - 'number': 65.0, - 'float': 62.4, - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.api_client.deserialize(response, (format_test.FormatTest,), True) - self.assertTrue(isinstance(deserialized, format_test.FormatTest)) - - with self.checkRaiseRegex(petstore_api.exceptions.ApiValueError, "Invalid value for `integer`, value must be a multiple of `2`"): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2'. An error must be raised - 'number': 65.0, - 'float': 62.4, - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.api_client.deserialize(response, (format_test.FormatTest,), True) - - # Disable JSON schema validation. No error should be raised during deserialization. - config = petstore_api.Configuration() - config.disabled_client_side_validations = "multipleOf" - api_client = petstore_api.ApiClient(configuration=config) - - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2' - 'number': 65.0, - 'float': 62.4, - } - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, (format_test.FormatTest,), True) - self.assertTrue(isinstance(deserialized, format_test.FormatTest)) - - # Disable JSON schema validation but for a different keyword. - # An error should be raised during deserialization. - config = petstore_api.Configuration() - config.disabled_client_side_validations = "maxItems" - api_client = petstore_api.ApiClient(configuration=config) - - with self.checkRaiseRegex(petstore_api.exceptions.ApiValueError, "Invalid value for `integer`, value must be a multiple of `2`"): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2' - 'number': 65.0, - 'float': 62.4, - } - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, (format_test.FormatTest,), True) - - def test_sanitize_for_serialization(self): - data = { - "prop1": [{"key1": "val1"}], - "prop2": {"key2": "val2"} - } - from petstore_api.model.foo_object import FooObject - # the property named prop1 of this model is a list of dict - foo_object = FooObject(prop1=data["prop1"], prop2=data["prop2"]) - result = self.api_client.sanitize_for_serialization(foo_object) - self.assertEqual(data, result) diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py deleted file mode 100644 index 09f386f23aa1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.boolean_enum import BooleanEnum - - -class TestBooleanEnum(unittest.TestCase): - """BooleanEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBooleanEnum(self): - """Test BooleanEnum""" - model = BooleanEnum(True) - assert model.value is True - - assert BooleanEnum.allowed_values[('value',)]['TRUE'] is True - - with self.assertRaises(petstore_api.ApiValueError): - BooleanEnum(False) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py deleted file mode 100644 index dde99076977c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations - - -class TestComposedOneOfNumberWithValidations(unittest.TestCase): - """ComposedOneOfNumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testComposedOneOfNumberWithValidations(self): - """Test ComposedOneOfNumberWithValidations""" - # we can make an instance that stores float data - inst = ComposedOneOfNumberWithValidations(10.0) - from petstore_api.model import number_with_validations - assert isinstance(inst, number_with_validations.NumberWithValidations) - # we can make an instance that stores object (dict) data - inst = ComposedOneOfNumberWithValidations(class_name="Cat", color="black") - assert isinstance(inst, ComposedOneOfNumberWithValidations) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py deleted file mode 100644 index d219a4e4b8aa..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py +++ /dev/null @@ -1,45 +0,0 @@ -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag -globals()['Tag'] = Tag -from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps - - -class TestComposedSchemaWithPropsAndNoAddProps(unittest.TestCase): - """ComposedSchemaWithPropsAndNoAddProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testComposedSchemaWithPropsAndNoAddProps(self): - """Test ComposedSchemaWithPropsAndNoAddProps""" - - inst = ComposedSchemaWithPropsAndNoAddProps(color='red') - - # ComposedSchemaWithPropsAndNoAddProps should only allow in the color property - # once https://github.com/OpenAPITools/openapi-generator/pull/8816 lands - # this will no longer work - # TODO update the test then - inst = ComposedSchemaWithPropsAndNoAddProps(color='red', id=1, name='foo') - - with self.assertRaises(petstore_api.ApiAttributeError): - inst = ComposedSchemaWithPropsAndNoAddProps(color='red', id=1, name='foo', additional=5) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py deleted file mode 100644 index e70fd67b343f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py +++ /dev/null @@ -1,42 +0,0 @@ -from copy import deepcopy -import unittest -from petstore_api.model.mammal import Mammal -from petstore_api.model.triangle import Triangle -from petstore_api.model.dog import Dog - -class TestCopy(unittest.TestCase): - """TestCopy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDeepCopyOneOf(self): - """test deepcopy""" - obj = deepcopy(Mammal(class_name="whale")) - assert id(deepcopy(obj)) != id(obj) - assert deepcopy(obj) == obj - - def testDeepCopyAllOf(self): - """test deepcopy""" - obj = Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle", foo="blah") - assert id(deepcopy(obj)) != id(obj) - assert deepcopy(obj) == obj - - obj = Triangle._new_from_openapi_data(shape_type="Triangle", triangle_type="EquilateralTriangle", foo="blah") - assert id(deepcopy(obj)) != id(obj) - assert deepcopy(obj) == obj - - obj = Dog._new_from_openapi_data(class_name='Dog', color='white', breed='Jack Russel Terrier') - assert id(deepcopy(obj)) != id(obj) - assert deepcopy(obj) == obj - - obj = Dog(class_name='Dog', color='white', breed='Jack Russel Terrier') - assert id(deepcopy(obj)) != id(obj) - assert deepcopy(obj) == obj - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py deleted file mode 100644 index 99320920f411..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py +++ /dev/null @@ -1,326 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -import json -import time -import unittest -import datetime - -import petstore_api -from petstore_api.model import ( - shape, - equilateral_triangle, - animal, - dog, - apple, - mammal, - whale, - zebra, - banana, - fruit_req, - drawing, - banana_req, - number_with_validations, -) - - -MockResponse = namedtuple('MockResponse', 'data') - - -class DeserializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.deserialize = self.api_client.deserialize - - def test_deserialize_shape(self): - """ - - deserialize Shape to an instance of: - - EquilateralTriangle - - IsoscelesTriangle - - IsoscelesTriangle - - ScaleneTriangle - - ComplexQuadrilateral - - SimpleQuadrilateral - by traveling through 2 discriminators - """ - shape_type, triangle_type = ['Triangle', 'EquilateralTriangle'] - data = { - 'shapeType': shape_type, - 'triangleType': triangle_type, - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (shape.Shape,), True) - self.assertTrue(isinstance(deserialized, equilateral_triangle.EquilateralTriangle)) - self.assertEqual(deserialized.shape_type, shape_type) - self.assertEqual(deserialized.triangle_type, triangle_type) - - # invalid second discriminator value - shape_type, quadrilateral_type = ['Quadrilateral', 'Triangle'] - data = { - 'shapeType': shape_type, - 'quadrilateralType': quadrilateral_type, - } - response = MockResponse(data=json.dumps(data)) - - err_msg = ("Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '{}'='{}' at path: ()" - ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("quadrilateralType", "Triangle") - ): - self.deserialize(response, (shape.Shape,), True) - - def test_deserialize_animal(self): - """ - deserialize Animal to a Dog instance - Animal uses a discriminator which has a map built of child classes - that inherit from Animal - This is the swagger (v2) way of doing something like oneOf composition - """ - class_name = 'Dog' - color = 'white' - breed = 'Jack Russel Terrier' - data = { - 'className': class_name, - 'color': color, - 'breed': breed - } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (animal.Animal,), True) - self.assertTrue(isinstance(deserialized, dog.Dog)) - self.assertEqual(deserialized.class_name, class_name) - self.assertEqual(deserialized.color, color) - self.assertEqual(deserialized.breed, breed) - - def test_regex_constraint(self): - """ - Test regex pattern validation. - """ - - # Test with valid regex pattern. - inst = apple.Apple( - cultivar="Akane" - ) - assert isinstance(inst, apple.Apple) - - # Test with invalid regex pattern in cultivar - err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("cultivar", "[^`]*") - ): - inst = apple.Apple( - cultivar="!@#%@$#Akane" - ) - - # Test with invalid regex pattern in origin - err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("origin", "[^`]*") - ): - inst = apple.Apple( - cultivar="Akane", - origin="!@#%@$#Chile" - ) - - def test_deserialize_mammal(self): - """ - deserialize mammal - mammal is a oneOf composed schema model with discriminator - """ - - # whale test - has_baleen = True - has_teeth = False - class_name = 'whale' - data = { - 'hasBaleen': has_baleen, - 'hasTeeth': has_teeth, - 'className': class_name - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertTrue(isinstance(deserialized, whale.Whale)) - self.assertEqual(deserialized.has_baleen, has_baleen) - self.assertEqual(deserialized.has_teeth, has_teeth) - self.assertEqual(deserialized.class_name, class_name) - - # zebra test - zebra_type = 'plains' - class_name = 'zebra' - data = { - 'type': zebra_type, - 'className': class_name - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertTrue(isinstance(deserialized, zebra.Zebra)) - self.assertEqual(deserialized.type, zebra_type) - self.assertEqual(deserialized.class_name, class_name) - - def test_deserialize_float_value(self): - """ - Deserialize floating point values. - """ - data = { - 'lengthCm': 3.1415 - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana.Banana,), True) - self.assertTrue(isinstance(deserialized, banana.Banana)) - self.assertEqual(deserialized.length_cm, 3.1415) - - # Float value is serialized without decimal point - data = { - 'lengthCm': 3 - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana.Banana,), True) - self.assertTrue(isinstance(deserialized, banana.Banana)) - self.assertEqual(deserialized.length_cm, 3.0) - - def test_deserialize_fruit_null_value(self): - """ - deserialize fruit with null value. - fruitReq is a oneOf composed schema model with discriminator, including 'null' type. - """ - - # Unmarshal 'null' value - data = None - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (fruit_req.FruitReq, type(None)), True) - self.assertEqual(type(deserialized), type(None)) - - inst = fruit_req.FruitReq(None) - self.assertIsNone(inst) - - def test_deserialize_with_additional_properties(self): - """ - Deserialize data with schemas that have the additionalProperties keyword. - Test conditions when additional properties are allowed, not allowed, have - specific types... - """ - - # Dog is allOf with two child schemas. - # The OAS document for Dog does not specify the 'additionalProperties' keyword, - # which means that by default, the Dog schema must allow undeclared properties. - # The additionalProperties keyword is used to control the handling of extra stuff, - # that is, properties whose names are not listed in the properties keyword. - # By default any additional properties are allowed. - data = { - 'className': 'Dog', - 'color': 'brown', - 'breed': 'golden retriever', - # Below are additional, undeclared properties. - 'group': 'Terrier Group', - 'size': 'medium', - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (dog.Dog,), True) - self.assertEqual(type(deserialized), dog.Dog) - self.assertEqual(deserialized.class_name, 'Dog') - self.assertEqual(deserialized.breed, 'golden retriever') - - # The 'zebra' schema allows additional properties by explicitly setting - # additionalProperties: true. - # This is equivalent to 'additionalProperties' not being present. - data = { - 'class_name': 'zebra', - 'type': 'plains', - # Below are additional, undeclared properties - 'group': 'abc', - 'size': 3, - 'p1': True, - 'p2': [ 'a', 'b', 123], - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertEqual(type(deserialized), zebra.Zebra) - self.assertEqual(deserialized.class_name, 'zebra') - self.assertEqual(deserialized.type, 'plains') - self.assertEqual(deserialized.p1, True) - - # The 'bananaReq' schema disallows additional properties by explicitly setting - # additionalProperties: false - err_msg = ("{} has no attribute '{}' at ") - with self.assertRaisesRegex( - petstore_api.exceptions.ApiAttributeError, - err_msg.format("BananaReq", "unknown-group") - ): - data = { - 'lengthCm': 21.2, - 'sweet': False, - # Below are additional, undeclared properties. They are not allowed, - # an exception must be raised. - 'unknown-group': 'abc', - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana_req.BananaReq,), True) - self.assertEqual(type(deserialized), banana_req.BananaReq) - self.assertEqual(deserialized.lengthCm, 21) - self.assertEqual(deserialized.p1, True) - - def test_deserialize_with_additional_properties_and_reference(self): - """ - Deserialize data with schemas that has the additionalProperties keyword - and the schema is specified as a reference ($ref). - """ - data = { - 'main_shape': { - 'shape_type': 'Triangle', - 'triangle_type': 'EquilateralTriangle', - }, - 'shapes': [ - { - 'shape_type': 'Triangle', - 'triangle_type': 'IsoscelesTriangle', - }, - { - 'shape_type': 'Quadrilateral', - 'quadrilateral_type': 'ComplexQuadrilateral', - }, - ], - } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (drawing.Drawing,), True) - - def test_deserialize_NumberWithValidations(self): - """ deserialize NumberWithValidations """ - # make sure that an exception is thrown on an invalid type value - with self.assertRaises(petstore_api.ApiTypeError): - self.deserialize( - MockResponse(data=json.dumps("test str")), - (number_with_validations.NumberWithValidations,), - True - ) - - # make sure that an exception is thrown on an invalid value - with self.assertRaises(petstore_api.ApiValueError): - self.deserialize( - MockResponse(data=json.dumps(21.0)), - (number_with_validations.NumberWithValidations,), - True - ) - - # valid value works - number_val = 11.0 - response = MockResponse(data=json.dumps(number_val)) - number = self.deserialize(response, - (number_with_validations.NumberWithValidations,), True) - self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) - self.assertTrue(number.value == number_val) diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py deleted file mode 100644 index ed1ca736d4ba..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" -from collections import namedtuple -import json -import re -import unittest - -import petstore_api -from petstore_api.model import cat, dog, isosceles_triangle, banana_req, fruit_req -from petstore_api import Configuration, signing - -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -MockResponse = namedtuple('MockResponse', 'data') - -class DiscardUnknownPropertiesTests(unittest.TestCase): - - def test_deserialize_banana_req_do_not_discard_unknown_properties(self): - """ - deserialize bananaReq with unknown properties. - Strict validation is enabled. - Simple (non-composed) schema scenario. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in the bananaReq schema (additionalProperties: false). - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation raises an exception because the 'unknown_property' - # is undeclared. - with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: - deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) - self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - - def test_deserialize_fruit_req_do_not_discard_unknown_properties(self): - """ - deserialize FruitReq with unknown properties. - Strict validation is enabled. - Composed schema scenario. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in the schema (additionalProperties: false). - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation raises an exception because the 'unknown_property' - # is undeclared. - with self.assertRaisesRegex(petstore_api.ApiValueError, "Invalid inputs given to generate an instance of FruitReq. None of the oneOf schemas matched the input data."): - deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) - - - def test_deserialize_fruit_req_discard_unknown_properties(self): - """ - deserialize FruitReq with unknown properties. - Strict validation is enabled. - Composed schema scenario. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in BananaReq - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) - self.assertNotIn("unknown_property", deserialized.to_dict().keys()) - - - def test_deserialize_banana_req_discard_unknown_properties(self): - """ - Deserialize bananaReq with unknown properties. - Discard unknown properties. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below are additional (undeclared) properties not specified in the bananaReq schema. - 'unknown_property': 'a-value', - 'more-unknown': [ - 'a' - ] - } - # The 'unknown_property' is undeclared, which would normally raise an exception, but - # when discard_unknown_keys is set to True, the unknown properties are discarded. - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) - self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) - # Check the 'unknown_property' and 'more-unknown' properties are not present in the - # output. - self.assertIn("length_cm", deserialized.to_dict().keys()) - self.assertNotIn("unknown_property", deserialized.to_dict().keys()) - self.assertNotIn("more-unknown", deserialized.to_dict().keys()) - - def test_deserialize_cat_do_not_discard_unknown_properties(self): - """ - Deserialize Cat with unknown properties. - Strict validation is enabled. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - "class_name": "Cat", - "color": "black", - "declawed": True, - "dynamic-property": 12345, - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation does not raise an exception because the even though - # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties - # attribute. - deserialized = api_client.deserialize(response, ((cat.Cat),), True) - self.assertTrue(isinstance(deserialized, cat.Cat)) - self.assertIn('color', deserialized.to_dict()) - self.assertEqual(deserialized['color'], 'black') - - def test_deserialize_cat_discard_unknown_properties(self): - """ - Deserialize Cat with unknown properties. - Request to discard unknown properties, but Cat is composed schema - with one inner schema that has 'additionalProperties' set to true. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - "class_name": "Cat", - "color": "black", - "declawed": True, - # Below are additional (undeclared) properties. - "my_additional_property": 123, - } - # The 'my_additional_property' is undeclared - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((cat.Cat),), True) - self.assertTrue(isinstance(deserialized, cat.Cat)) - # Check the 'my_additional_property' is present - self.assertIn("my_additional_property", deserialized.to_dict().keys()) - diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py deleted file mode 100644 index 327e01fb849f..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import nullable_shape -except ImportError: - nullable_shape = sys.modules[ - 'petstore_api.model.nullable_shape'] -try: - from petstore_api.model import shape -except ImportError: - shape = sys.modules[ - 'petstore_api.model.shape'] -try: - from petstore_api.model import shape_or_null -except ImportError: - shape_or_null = sys.modules[ - 'petstore_api.model.shape_or_null'] -from petstore_api.model.drawing import Drawing - - -class TestDrawing(unittest.TestCase): - """Drawing unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_create_instances(self): - """ - Validate instance can be created using pythonic name or OAS names. - """ - - # Validate object can be created using pythonic names. - inst = shape.Shape( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" - ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - assert isinstance(inst, IsoscelesTriangle) - - # Validate object can be created using OAS names. - # For example, this can be used to construct objects on the client - # when the input data is available as JSON documents. - data = { - 'shapeType': "Triangle", - 'triangleType': "IsoscelesTriangle" - } - inst = shape.Shape(_spec_property_naming=True, **data) - assert isinstance(inst, IsoscelesTriangle) - - def test_deserialize_oneof_reference(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - """ - isosceles_triangle = shape.Shape( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" - ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - from petstore_api.model.triangle import Triangle - from petstore_api.model.equilateral_triangle import EquilateralTriangle - - assert isinstance(isosceles_triangle, IsoscelesTriangle) - inst = Drawing( - # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] - # composed schema. So we should be able to assign a petstore_api.Triangle - # to a 'main_shape'. - main_shape=isosceles_triangle, - shapes=[ - shape.Shape( - shape_type="Triangle", - triangle_type="EquilateralTriangle" - ), - Triangle( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" - ), - EquilateralTriangle( - shape_type="Triangle", - triangle_type="EquilateralTriangle" - ), - shape.Shape( - shape_type="Quadrilateral", - quadrilateral_type="ComplexQuadrilateral" - ), - ], - ) - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral - assert isinstance(inst, Drawing) - assert isinstance(inst.main_shape, IsoscelesTriangle) - self.assertEqual(len(inst.shapes), 4) - assert isinstance(inst.shapes[0], EquilateralTriangle) - assert isinstance(inst.shapes[1], IsoscelesTriangle) - assert isinstance(inst.shapes[2], EquilateralTriangle) - assert isinstance(inst.shapes[3], ComplexQuadrilateral) - - # Validate we cannot assign the None value to main_shape because the 'null' type - # is not one of the allowed types in the 'Shape' schema. - err_msg = (r"Invalid type for variable '{}'. " - r"Required value type is {} and passed type was {} at {}") - with self.assertRaisesRegex( - petstore_api.ApiTypeError, - err_msg.format(r"main_shape", r"one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", r"NoneType", r"\['main_shape'\]") - ): - inst = Drawing( - # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] - # So the None value should not be allowed and an exception should be raised. - main_shape=None, - ) - - - def test_deserialize_oneof_reference_with_null_type(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - Further, the 'oneOf' schema has a 'null' type child schema (as introduced in - OpenAPI 3.1). - """ - - # Validate we can assign the None value to shape_or_null, because the 'null' type - # is one of the allowed types in the 'ShapeOrNull' schema. - inst = Drawing( - # 'shape_or_null' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] - shape_or_null=None, - ) - assert isinstance(inst, Drawing) - self.assertFalse(hasattr(inst, 'main_shape')) - self.assertTrue(hasattr(inst, 'shape_or_null')) - self.assertIsNone(inst.shape_or_null) - - - def test_deserialize_oneof_reference_with_nullable_type(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - Further, the 'oneOf' schema has the 'nullable' attribute (as introduced in - OpenAPI 3.0 and deprecated in 3.1). - """ - - # Validate we can assign the None value to nullable_shape, because the NullableShape - # has the 'nullable: true' attribute. - inst = Drawing( - # 'nullable_shape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] - # and the 'nullable: true' attribute. - nullable_shape=None, - ) - assert isinstance(inst, Drawing) - self.assertFalse(hasattr(inst, 'main_shape')) - self.assertTrue(hasattr(inst, 'nullable_shape')) - self.assertIsNone(inst.nullable_shape) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py deleted file mode 100644 index 946f985079ab..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.enum_test import EnumTest -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.array_of_enums import ArrayOfEnums -from petstore_api.model.boolean_enum import BooleanEnum - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - required_kwargs = dict(enum_string_required='lower') - - # inline array of enums - model = EnumTest( - inline_array_of_str_enum=[StringEnum('approved')], - **required_kwargs - ) - # refed array of enums - model = EnumTest( - array_of_str_enum=ArrayOfEnums([StringEnum('approved')]), - **required_kwargs - ) - - # inline bool enum - model = EnumTest( - enum_bool=False, - **required_kwargs - ) - # refed bool enum - model = EnumTest( - bool_enum=BooleanEnum(True), - **required_kwargs - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py deleted file mode 100644 index 9e49b9e71ba1..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py +++ /dev/null @@ -1,61 +0,0 @@ -import unittest -from unittest.mock import patch - -import petstore_api - - -class StubPoolManager(object): - actual_kwargs = None - - def __init__(self, num_pools=10, headers=None, **kwargs): - # Matches the contract of urllib3.PoolManager - self.actual_kwargs = kwargs - - -class StubProxyManager: - actual_kwargs = None - - def __init__( - self, - proxy_url, - num_pools=10, - headers=None, - proxy_headers=None, - **kwargs - ): - # Matches the contract of urllib3.ProxyManager - self.actual_kwargs = kwargs - - -class TestExtraOptionsForPools(unittest.TestCase): - - def test_socket_options_get_passed_to_pool_manager(self): - - socket_options = ["extra", "socket", "options"] - - config = petstore_api.Configuration(host="HOST") - config.socket_options = socket_options - - with patch("petstore_api.rest.urllib3.PoolManager", StubPoolManager): - api_client = petstore_api.ApiClient(config) - - # urllib3.PoolManager promises to pass socket_options in kwargs - # to the underlying socket. So asserting that our manager - # gets it is a good start - assert api_client.rest_client.pool_manager.actual_kwargs["socket_options"] == socket_options - - def test_socket_options_get_passed_to_proxy_manager(self): - - socket_options = ["extra", "socket", "options"] - - config = petstore_api.Configuration(host="http://somehost.local:8080") - config.socket_options = socket_options - config.proxy = "http://proxy.local:8080/" - - with patch("petstore_api.rest.urllib3.ProxyManager", StubProxyManager): - api_client = petstore_api.ApiClient(config) - - # urllib3.ProxyManager promises to pass socket_options in kwargs - # to the underlying socket. So asserting that our manager - # gets it is a good start - assert api_client.rest_client.pool_manager.actual_kwargs["socket_options"] == socket_options diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py deleted file mode 100644 index fe674cff4c66..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py +++ /dev/null @@ -1,823 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -import sys -from collections import namedtuple -import json -import unittest -from pathlib import Path -from unittest.mock import patch - -from urllib3.request import RequestMethods - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import RESTClientObject, RESTResponse -from petstore_api.model_utils import file_type, model_to_dict - -HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] -) - -headers = {'Content-Type': 'application/json'} -def get_headers(): - return {} -def get_header(name, default=None): - return {}.get(name, default) - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = FakeApi() # noqa: E501 - - def tearDown(self): - pass - - @staticmethod - def mock_response(body_value): - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(body_value).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - return RESTResponse(http_response) - - @staticmethod - def assert_request_called_with( - mock_method, - url, - accept='application/json', - http_method='POST', - content_type='application/json', - **kwargs - ): - headers = { - 'Accept': accept, - 'User-Agent': 'OpenAPI-Generator/1.0.0/python', - } - if content_type: - headers['Content-Type'] = content_type - used_kwargs = dict( - _preload_content=True, - _request_timeout=None, - headers=headers, - query_params=[] - ) - if 'post_params' in kwargs: - used_kwargs['post_params'] = kwargs['post_params'] - if 'body' in kwargs: - used_kwargs['body'] = kwargs['body'] - if 'post_params' not in used_kwargs: - used_kwargs['post_params'] = [] - mock_method.assert_called_with( - http_method, - url, - **used_kwargs - ) - - def test_array_model(self): - """Test case for array_model - - """ - from petstore_api.model import animal_farm, animal - endpoint = self.api.array_model_endpoint - assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) - assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: - cat = animal.Animal(class_name="Cat", color="black") - body = animal_farm.AnimalFarm([cat]) - json_data = [{"className": "Cat", "color": "black"}] - mock_method.return_value = self.mock_response(json_data) - - response = self.api.array_model(body=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', - body=json_data, - ) - - assert isinstance(response, animal_farm.AnimalFarm) - assert response == body - - def test_boolean(self): - """Test case for boolean - - """ - endpoint = self.api.boolean_endpoint - assert endpoint.openapi_types['body'] == (bool,) - assert endpoint.settings['response_type'] == (bool,) - - def test_recursionlimit(self): - """Test case for recursionlimit - - """ - assert sys.getrecursionlimit() == 1234 - - def test_fake_health_get(self): - """Test case for fake_health_get - - Health check endpoint # noqa: E501 - """ - pass - - def test_additional_properties_with_array_of_enums(self): - """Test case for additional_properties_with_array_of_enums - - Additional Properties with Array of Enums # noqa: E501 - """ - pass - - def test_enum_test(self): - """Test case for enum_test - - Object contains enum properties and array properties containing enums - """ - from petstore_api.model.enum_test import EnumTest - from petstore_api.model.string_enum import StringEnum - from petstore_api.model.array_of_enums import ArrayOfEnums - - endpoint = self.api.enum_test_endpoint - assert endpoint.openapi_types['enum_test'] == (EnumTest,) - assert endpoint.settings['response_type'] == (EnumTest,) - - # serialization + deserialization works w/ inline array - with patch.object(RESTClientObject, 'request') as mock_method: - body = EnumTest( - enum_string_required='lower', - inline_array_of_str_enum=[StringEnum('approved')] - ) - json_value = {'enum_string_required': 'lower', 'InlineArrayOfStrEnum': ['approved']} - mock_method.return_value = self.mock_response(json_value) - - response = self.api.enum_test(enum_test=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', - body=json_value, - ) - - assert isinstance(response, EnumTest) - assert response == body - - # serialization + deserialization works w/ refed array - with patch.object(RESTClientObject, 'request') as mock_method: - body = EnumTest( - enum_string_required='lower', - array_of_str_enum=ArrayOfEnums([StringEnum('approved')]) - ) - json_value = {'enum_string_required': 'lower', 'ArrayOfStrEnum': ['approved']} - mock_method.return_value = self.mock_response(json_value) - - response = self.api.enum_test(enum_test=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', - body=json_value, - ) - - assert isinstance(response, EnumTest) - assert response == body - - - def test_array_of_enums(self): - """Test case for array_of_enums - - Array of Enums # noqa: E501 - """ - from petstore_api.model import array_of_enums, string_enum - endpoint = self.api.array_of_enums_endpoint - assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) - assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: - value = [string_enum.StringEnum("placed")] - body = array_of_enums.ArrayOfEnums(value) - value_simple = ["placed"] - mock_method.return_value = self.mock_response(value_simple) - - response = self.api.array_of_enums(array_of_enums=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', - body=value_simple, - ) - - assert isinstance(response, array_of_enums.ArrayOfEnums) - assert response.value == value - - def test_number_with_validations(self): - """Test case for number_with_validations - - """ - from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint - assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) - assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: - value = 10.0 - body = number_with_validations.NumberWithValidations(value) - mock_method.return_value = self.mock_response(value) - - response = self.api.number_with_validations(body=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/number', - body=value, - ) - - assert isinstance(response, number_with_validations.NumberWithValidations) - assert response.value == value - - def test_object_model_with_ref_props(self): - """Test case for object_model_with_ref_props - - """ - from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - from petstore_api.model.number_with_validations import NumberWithValidations - endpoint = self.api.object_model_with_ref_props_endpoint - assert endpoint.openapi_types['body'] == (ObjectModelWithRefProps,) - assert endpoint.settings['response_type'] == (ObjectModelWithRefProps,) - - json_payloads = [ - {}, # only required + no optional properties works - { # optional properties works - "my_number": 11.0, - "my_string": 'a', - "my_boolean": True, - } - ] - # instantiation works - expected_models = [ - ObjectModelWithRefProps(), - ObjectModelWithRefProps( - my_number=NumberWithValidations(11.0), - my_string='a', - my_boolean=True - ) - ] - - pairs = zip(json_payloads, expected_models) - # serialization + deserialization works - for (json_payload, expected_model) in pairs: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = self.mock_response(json_payload) - - response = self.api.object_model_with_ref_props(body=expected_model) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/object_model_with_ref_props', - body=json_payload, - ) - - assert isinstance(response, expected_model.__class__) - assert response == expected_model - - def test_composed_one_of_number_with_validations(self): - """Test case for composed_one_of_number_with_validations - - """ - from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations - endpoint = self.api.composed_one_of_number_with_validations_endpoint - assert endpoint.openapi_types['composed_one_of_number_with_validations'] == ( - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) - assert endpoint.settings['response_type'] == ( - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) - - # serialization + deserialization works - num_with_validations = number_with_validations.NumberWithValidations(10.0) - cat_in_composed = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations( - class_name="Cat", color="black" - ) - import datetime - date = datetime.date(1970, 1, 1) - body_value_simple = [ - (num_with_validations, 10.0), - (cat_in_composed, {"className": "Cat", "color": "black"}), - (None, None), - (date, '1970-01-01'), - ] - for (body, value_simple) in body_value_simple: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = self.mock_response(value_simple) - - response = self.api.composed_one_of_number_with_validations(composed_one_of_number_with_validations=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', - body=value_simple, - ) - - assert isinstance(response, body.__class__) - assert response == body - - def test_string(self): - """Test case for string - - """ - endpoint = self.api.string_endpoint - assert endpoint.openapi_types['body'] == (str,) - assert endpoint.settings['response_type'] == (str,) - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: - body = "blah" - value_simple = body - mock_method.return_value = self.mock_response(value_simple) - - response = self.api.string(body=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/string', - body=value_simple, - ) - - assert isinstance(response, str) - assert response == value_simple - - def test_string_enum(self): - """Test case for string_enum - - """ - from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint - assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) - assert endpoint.settings['response_type'] == (string_enum.StringEnum,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - value = "placed" - body = string_enum.StringEnum(value) - mock_method.return_value = self.mock_response(value) - - response = self.api.string_enum(body=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/enum', - body=value, - ) - - assert isinstance(response, string_enum.StringEnum) - assert response.value == value - - def test_upload_file(self): - # uploads a file - file_path1 = Path(__file__, "..", "..", "testfiles", "1px_pic1.png").resolve() - - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") - try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.api.upload_file( - file=file1) - body = None - post_params=[ - ('file', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ] - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/uploadFile', - body=body, post_params=post_params, content_type='multipart/form-data' - ) - except petstore_api.ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - - # passing in an array of files to when file only allows one - # raises an exceptions - try: - file = open(file_path1, "rb") - with self.assertRaises(petstore_api.ApiTypeError) as exc: - self.api.upload_file(file=[file]) - finally: - file.close() - - # passing in a closed file raises an exception - with self.assertRaises(petstore_api.ApiValueError) as exc: - file = open(file_path1, "rb") - file.close() - self.api.upload_file(file=file) - - def test_upload_files(self): - file_path1 = Path(__file__, "..", "..", "testfiles", "1px_pic1.png").resolve() - file_path2 = Path(__file__, "..", "..", "testfiles", "1px_pic2.png").resolve() - - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") - file2 = open(file_path2, "rb") - try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.api.upload_files( - files=[file1, file2]) - post_params=[ - ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) - ] - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/uploadFiles', - body=None, post_params=post_params, content_type='multipart/form-data' - ) - except petstore_api.ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - file2.close() - - # passing in a single file when an array of file is required - # raises an exception - try: - file = open(file_path1, "rb") - with self.assertRaises(petstore_api.ApiTypeError) as exc: - self.api.upload_files(files=file) - finally: - file.close() - - def test_upload_with_mime_type(self): - """Upload a file, while setting a MIME type for that file. - - Verify that: - - * ``post_params`` may contain a three-tuple in the form ``(file_name, file_handle, - file_mime_type)`` - * This three-tuple is passed to urllib3 as a tuple, without being converted to a list. - - See: - - * https://github.com/OpenAPITools/openapi-generator/issues/14012 - * https://urllib3.readthedocs.io/en/stable/reference/urllib3.request.html - """ - file_path = Path(__file__, "..", "..", "testfiles", "1px_pic1.png").resolve() - file_mime_type = "image/png" - with patch.object(RequestMethods, 'request') as request: - with open(file_path, mode="rb") as file_handle: - request.return_value.status = 200 - resp = self.api.api_client.call_api( - resource_path="/fake/uploadFile", - method="POST", - header_params={"Content-Type": "multipart/form-data"}, - post_params={"file": (file_path.name, file_handle, file_mime_type)}, - ) - - # a single multipart/form-data POST call was made, with a single form field - request.assert_called_once() - fields = request.call_args.kwargs['fields'] - self.assertEqual(len(fields), 1, fields) - field = fields[0] - - # it is in the form (form_field_name, (filename, filedata, mimetype)) - self.assertEqual(field[0], "file") - self.assertEqual(field[1][0], file_path.name) - with open(file_path, mode="rb") as file_handle: - self.assertEqual(field[1][1], file_handle.read()) - self.assertEqual(field[1][2], file_mime_type) - - # the form field value wasn't cast to a list - self.assertIsInstance(fields[0][1], tuple) - - def test_download_attachment(self): - """Ensures that file deserialization works""" - - # sample from http://www.jtricks.com/download-text - file_name = 'content.txt' - headers_dict = { - 'with_filename': {'Content-Disposition': 'attachment; filename={}'.format(file_name), 'Content-Type': 'text/plain'}, - 'no_filename': {'Content-Disposition': 'attachment;', 'Content-Type': 'text/plain'} - } - def get_headers(*args): - return args - file_data = ( - "You are reading text file that was supposed to be downloaded\r\n" - "to your hard disk. If your browser offered to save you the file," - "\r\nthen it handled the Content-Disposition header correctly." - ) - for key, headers in headers_dict.items(): - def get_header(name, default=None): - return headers_dict[key].get(name, default) - http_response = HTTPResponse( - status=200, - reason='OK', - data=file_data, - getheaders=get_headers(headers), - getheader=get_header - ) - # deserialize response to a file - mock_response = RESTResponse(http_response) - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - try: - file_object = self.api.download_attachment(file_name='download-text') - self.assert_request_called_with( - mock_method, - 'http://www.jtricks.com/download-text', - http_method='GET', - accept='text/plain', - content_type=None, - ) - self.assertTrue(isinstance(file_object, file_type)) - self.assertFalse(file_object.closed) - self.assertEqual(file_object.read(), file_data.encode('utf-8')) - finally: - file_object.close() - Path(file_object.name).unlink() - - def test_upload_download_file(self): - file_path1 = Path(__file__, "..", "..", "testfiles", "1px_pic1.png").resolve() - - with open(file_path1, "rb") as f: - expected_file_data = f.read() - - headers = {'Content-Type': 'application/octet-stream'} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - http_response = HTTPResponse( - status=200, - reason='OK', - data=expected_file_data, - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") - try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - downloaded_file = self.api.upload_download_file(body=file1) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=expected_file_data, - content_type='application/octet-stream', - accept='application/octet-stream' - ) - - self.assertTrue(isinstance(downloaded_file, file_type)) - self.assertFalse(downloaded_file.closed) - self.assertEqual(downloaded_file.read(), expected_file_data) - except petstore_api.ApiException as e: - self.fail("upload_download_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - downloaded_file.close() - Path(downloaded_file.name).unlink() - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - def test_test_query_parameter_collection_format(self): - """Test case for test_query_parameter_collection_format - - """ - pass - - def test_post_inline_additional_properties_ref_payload(self): - """Test case for postInlineAdditionlPropertiesRefPayload - """ - from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - endpoint = self.api.post_inline_additional_properties_ref_payload_endpoint - assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,) - assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'arrayData': [ - { - 'labels': [ - None, - 'foo' - ] - } - ] - } - inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) - ] - ) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.post_inline_additional_properties_ref_payload(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesRefPayload', - body=expected_json_body - ) - - assert isinstance(response, InlineAdditionalPropertiesRefPayload) - assert model_to_dict(response) == expected_json_body - - def test_post_inline_additional_properties_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - endpoint = self.api.post_inline_additional_properties_payload_endpoint - assert endpoint.openapi_types['post_inline_additional_properties_payload_request'] == (PostInlineAdditionalPropertiesPayloadRequest,) - assert endpoint.settings['response_type'] == (PostInlineAdditionalPropertiesPayloadRequest,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'arrayData': [ - { - 'labels': [ - None, - 'foo' - ] - } - ] - } - post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) - ] - ) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesPayload', - body=expected_json_body - ) - - assert isinstance(response, PostInlineAdditionalPropertiesPayloadRequest) - assert model_to_dict(response) == expected_json_body - - def test_post_tx_rx_any_of_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties - endpoint = self.api.tx_rx_any_of_model_endpoint - assert endpoint.openapi_types['gm_fruit_no_properties'] == (GmFruitNoProperties,) - assert endpoint.settings['response_type'] == (GmFruitNoProperties,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'cultivar': 'Alice', - 'origin': 'Kazakhstan', - 'lengthCm': 7, - } - fruit = GmFruitNoProperties(**expected_json_body) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.tx_rx_any_of_model(gm_fruit_no_properties=fruit) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/TxRxAnyOfModel', - body=expected_json_body - ) - - assert isinstance(response, GmFruitNoProperties) - assert model_to_dict(response) == expected_json_body - - def test_post_tx_rx_all_of_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.stream_options import StreamOptions - from petstore_api.model.publish_options_publish import PublishOptionsPublish - endpoint = self.api.tx_rx_all_of_model_endpoint - assert endpoint.openapi_types['stream_options'] == (StreamOptions,) - assert endpoint.settings['response_type'] == (StreamOptions,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - "egressThresholds": { - "person":0.8 - }, - "publish": { - "egressUnknownDetections": False - } - } - stream_option_instance = StreamOptions(**expected_json_body) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.tx_rx_all_of_model(stream_options=stream_option_instance) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/TxRxAllOfModel', - body=expected_json_body - ) - - assert isinstance(response, StreamOptions) - assert model_to_dict(response) == expected_json_body - assert response.publish == PublishOptionsPublish(**{"egress_unknown_detections": False}) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py deleted file mode 100644 index a0f97a4a97dc..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py +++ /dev/null @@ -1,247 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.fruit import Fruit - - -class TestFruit(unittest.TestCase): - """Fruit unit test stubs""" - - length_cm = 20.3 - color = 'yellow' - - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_fruit_with_additional_props(self): - # including extra parameters works because the oneOf models include additionalProperties - some_value = 'some_value' - some_fruit = Fruit( - color=self.color, - length_cm=self.length_cm, - unknown_property=some_value - ) - assert some_fruit['unknown_property'] == some_value - - def test_fruit_assigning_additional_props_in_client(self): - # setting a value that doesn't exist works because additional_properties_type allows any type - other_fruit = Fruit(length_cm=self.length_cm, color=self.color) - blah = 'blah' - other_fruit['a'] = blah - assert other_fruit.a == blah - - # with setattr - setattr(other_fruit, 'b', blah) - assert other_fruit.b == blah - - self.assertEqual( - other_fruit.to_dict(), - { - 'a': 'blah', - 'b': 'blah', - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - def test_fruit_access_errors(self): - fruit = Fruit(length_cm=self.length_cm, color=self.color) - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - - # Per Python doc, if the named attribute does not exist, - # default is returned if provided, otherwise AttributeError is raised. - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') - - def test_fruit_attribute_access(self): - fruit = Fruit(length_cm=self.length_cm, color=self.color) - - # Assert that we can call the builtin hasattr() function. - # hasattr should return False for non-existent attribute. - # Internally hasattr catches the AttributeError exception. - self.assertFalse(hasattr(fruit, 'invalid_variable')) - - # Assert that we can call the builtin hasattr() function. - # hasattr should return True for existent attribute. - self.assertTrue(hasattr(fruit, 'color')) - - # with getattr - # Per Python doc, if the named attribute does not exist, - # default is returned if provided. - self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') - self.assertEqual(fruit.get('cultivar'), None) - self.assertEqual(fruit.get('cultivar', 'some value'), 'some value') - - def test_banana_fruit(self): - """Test Fruit""" - - # make an instance of Fruit, a composed schema oneOf model - # banana test - fruit = Fruit(length_cm=self.length_cm, color=self.color) - # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(fruit.get('length_cm'), self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - self.assertEqual(fruit.color, self.color) - self.assertEqual(fruit['color'], self.color) - self.assertEqual(getattr(fruit, 'color'), self.color) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info - self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [], - 'allOf': [], - 'oneOf': [ - apple.Apple, - banana.Banana, - ], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - self.assertEqual(len(fruit._composed_instances), 1) - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - print(fruit._var_name_to_model_instances) - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - banana_instance.length_cm = 4.56 - with self.assertRaises(petstore_api.ApiValueError): - some_length_cm = fruit.length_cm - - # including input parameters for two oneOf instances raise an exception - with self.assertRaises(petstore_api.ApiValueError): - fruit = Fruit( - length_cm=self.length_cm, - cultivar='granny smith' - ) - - def test_apple_fruit(self): - - # make an instance of Fruit, a composed schema oneOf model - # apple test - color = 'red' - cultivar = 'golden delicious' - fruit = Fruit(color=color, cultivar=cultivar) - # check its properties - self.assertEqual(fruit.color, color) - self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'color': color, - 'cultivar': cultivar - } - ) - - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_null_fruit(self): - # Since 'apple' is nullable, validate we can create an apple with the 'null' value. - fruit = apple.Apple(None) - self.assertIsNone(fruit) - - # 'banana' is not nullable. - with self.assertRaises(petstore_api.ApiTypeError): - banana.Banana(None) - - # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, - # validate we can create a fruit with the 'null' value. - fruit = Fruit(None) - self.assertIsNone(fruit) - - # Redo the same thing, this time passing a null Apple to the Fruit constructor. - fruit = Fruit(apple.Apple(None)) - self.assertIsNone(fruit) - - def test_fruit_with_invalid_input_type(self): - - """ - color must be a str, color's str type is only defined at the Fruit level - Banana + Apple would allow color to be assigned with any type of value - """ - invalid_value = 1 - with self.assertRaises(petstore_api.ApiTypeError): - fruit = Fruit(color=invalid_value, length_cm=self.length_cm) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py deleted file mode 100644 index 64b710fdd583..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py +++ /dev/null @@ -1,175 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model import apple_req -from petstore_api.model import banana_req -from petstore_api.model.fruit_req import FruitReq - - -class TestFruitReq(unittest.TestCase): - """FruitReq unit test stubs""" - length_cm = 20.3 - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_fruit_access_errors(self): - fruit = FruitReq(length_cm=self.length_cm) - - # setting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - fruit['invalid_variable'] = 'some value' - # with setattr - with self.assertRaises(AttributeError): - setattr(fruit, 'invalid_variable', 'some value') - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') - - def test_FruitReq_banana(self): - """Test FruitReq""" - - # make an instance of Fruit, a composed schema oneOf model - # banana test - fruit = FruitReq(length_cm=self.length_cm) - # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'length_cm': self.length_cm, - } - ) - - # with getattr - self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') - - # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info - self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [], - 'allOf': [], - 'oneOf': [ - apple_req.AppleReq, - banana_req.BananaReq, - type(None), - ], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana_req.BananaReq: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'length_cm': [fruit, banana_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - banana_instance.length_cm = 4.56 - with self.assertRaises(petstore_api.ApiValueError): - some_length_cm = fruit.length_cm - - def test_invalid_inputs(self): - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - fruit = FruitReq( - length_cm=self.length_cm, - unknown_property='some value' - ) - - # including input parameters for two oneOf instances raise an exception - with self.assertRaises(petstore_api.ApiValueError): - fruit = FruitReq( - length_cm=self.length_cm, - cultivar='granny smith' - ) - - def test_FruitReq_apple(self): - """Test FruitReq""" - - # apple test - cultivar = 'golden delicious' - fruit = FruitReq(cultivar=cultivar) - # check its properties - self.assertEqual(fruit.cultivar, cultivar) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'cultivar': cultivar - } - ) - - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple_req.AppleReq: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_null_fruit(self): - # we can pass in None - fruit = FruitReq(None) - assert fruit is None - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py deleted file mode 100644 index bbe105c59bc9..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.gm_fruit import GmFruit - - -class TestGmFruit(unittest.TestCase): - """GmFruit unit test stubs""" - length_cm = 20.3 - color = 'yellow' - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_set_addprop_attributes(self): - # setting a value that doesn't exist works because additional_properties_type allows any type - other_fruit = GmFruit(length_cm=self.length_cm, color=self.color) - blah = 'blah' - other_fruit['a'] = blah - assert other_fruit.a == blah - - # with setattr - setattr(other_fruit, 'b', blah) - assert other_fruit.b == blah - - self.assertEqual( - other_fruit.to_dict(), - { - 'a': 'blah', - 'b': 'blah', - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - def test_banana_fruit(self): - """Test GmFruit""" - - # make an instance of GmFruit, a composed schema anyOf model - # banana test - fruit = GmFruit(length_cm=self.length_cm, color=self.color) - # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - self.assertEqual(fruit.color, self.color) - self.assertEqual(fruit['color'], self.color) - self.assertEqual(getattr(fruit, 'color'), self.color) - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - # with getattr - self.assertTrue(getattr(fruit, 'cultivar', 'some value'), 'some value') - - with self.assertRaises(AttributeError): - invalid_variable = getattr(fruit, 'cultivar') - - # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info - self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [ - apple.Apple, - banana.Banana, - ], - 'allOf': [], - 'oneOf': [], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_combo_fruit(self): - # including input parameters for both anyOf instances works - cultivar = 'banaple' - color = 'orange' - fruit = GmFruit( - color=color, - cultivar=cultivar, - length_cm=self.length_cm - ) - self.assertEqual(fruit.color, color) - self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - elif composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance, banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_apple_fruit(self): - # apple test - color = 'red' - cultivar = 'golden delicious' - origin = 'California' - fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) - # check its properties - self.assertEqual(fruit.color, color) - self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - - self.assertEqual(fruit.origin, origin) - self.assertEqual(fruit['origin'], origin) - self.assertEqual(getattr(fruit, 'origin'), origin) - - # check the dict representation - self.assertEqual( - fruit.to_dict(), - { - 'color': color, - 'cultivar': cultivar, - 'origin': origin, - } - ) - - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'cultivar': [fruit, apple_instance], - 'origin': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py deleted file mode 100644 index 771560948d58..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py +++ /dev/null @@ -1,516 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ docker pull swaggerapi/petstore -$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -from collections import namedtuple -from datetime import datetime, timedelta -import base64 -import json -import os -import re -import shutil -import unittest -from pathlib import Path -from urllib.parse import urlencode, urlparse - -from Crypto.Hash import SHA256, SHA512 -from Crypto.PublicKey import ECC, RSA -from Crypto.Signature import pkcs1_15, pss, DSS - -import petstore_api -from petstore_api.model import category, tag, pet -from petstore_api.api.pet_api import PetApi -from petstore_api import Configuration, signing -from petstore_api.rest import ( - RESTClientObject, - RESTResponse -) - -from petstore_api.exceptions import ( - ApiException, - ApiValueError, - ApiTypeError, -) - -from .util import id_gen - -import urllib3 - -from unittest.mock import patch - -HOST = 'http://localhost/v2' - -# This test RSA private key below is published in Appendix C 'Test Values' of -# https://www.ietf.org/id/draft-cavage-http-signatures-12.txt -RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF -NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F -UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB -AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA -QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK -kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg -f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u -412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc -mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 -kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA -gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW -G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI -7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== ------END RSA PRIVATE KEY-----""" - - -class TimeoutWithEqual(urllib3.Timeout): - def __init__(self, *arg, **kwargs): - super(TimeoutWithEqual, self).__init__(*arg, **kwargs) - - def __eq__(self, other): - return self._read == other._read and self._connect == other._connect and self.total == other.total - -class MockPoolManager(object): - def __init__(self, tc): - self._tc = tc - self._reqs = [] - - def expect_request(self, *args, **kwargs): - self._reqs.append((args, kwargs)) - - def set_signing_config(self, signing_cfg): - self.signing_cfg = signing_cfg - self._tc.assertIsNotNone(self.signing_cfg) - self.pubkey = self.signing_cfg.get_public_key() - self._tc.assertIsNotNone(self.pubkey) - - def request(self, *actual_request_target, **actual_request_headers_and_body): - self._tc.assertTrue(len(self._reqs) > 0) - expected_results = self._reqs.pop(0) - self._tc.maxDiff = None - expected_request_target = expected_results[0] # The expected HTTP method and URL path. - expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers - self._tc.assertEqual(expected_request_target, actual_request_target) - # actual_request_headers_and_body is a dict that contains the actual body, headers - for k, expected in expected_request_headers_and_body.items(): - self._tc.assertIn(k, actual_request_headers_and_body) - if k == 'body': - actual_body = actual_request_headers_and_body[k] - self._tc.assertEqual(expected, actual_body) - elif k == 'headers': - actual_headers = actual_request_headers_and_body[k] - for expected_header_name, expected_header_value in expected.items(): - # Validate the generated request contains the expected header. - self._tc.assertIn(expected_header_name, actual_headers) - actual_header_value = actual_headers[expected_header_name] - # Compare the actual value of the header against the expected value. - pattern = re.compile(expected_header_value) - m = pattern.match(actual_header_value) - self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( - expected_header_value,actual_header_value)) - if expected_header_name == 'Authorization': - self._validate_authorization_header( - expected_request_target, actual_headers, actual_header_value) - elif k == 'timeout': - self._tc.assertEqual(expected, actual_request_headers_and_body[k]) - return urllib3.HTTPResponse(status=200, body=b'test') - - def _validate_authorization_header(self, request_target, actual_headers, authorization_header): - """Validate the signature. - """ - # Extract (created) - r1 = re.compile(r'created=([0-9]+)') - m1 = r1.search(authorization_header) - self._tc.assertIsNotNone(m1) - created = m1.group(1) - - # Extract list of signed headers - r1 = re.compile(r'headers="([^"]+)"') - m1 = r1.search(authorization_header) - self._tc.assertIsNotNone(m1) - headers = m1.group(1).split(' ') - signed_headers_list = [] - for h in headers: - if h == '(created)': - signed_headers_list.append((h, created)) - elif h == '(request-target)': - url = request_target[1] - target_path = urlparse(url).path - signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path))) - else: - value = next((v for k, v in actual_headers.items() if k.lower() == h), None) - self._tc.assertIsNotNone(value) - signed_headers_list.append((h, value)) - header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] - string_to_sign = "\n".join(header_items) - digest = None - if self.signing_cfg.hash_algorithm == signing.HASH_SHA512: - digest = SHA512.new() - elif self.signing_cfg.hash_algorithm == signing.HASH_SHA256: - digest = SHA256.new() - else: - self._tc.fail("Unsupported hash algorithm: {0}".format(self.signing_cfg.hash_algorithm)) - digest.update(string_to_sign.encode()) - b64_body_digest = base64.b64encode(digest.digest()).decode() - - # Extract the signature - r2 = re.compile(r'signature="([^"]+)"') - m2 = r2.search(authorization_header) - self._tc.assertIsNotNone(m2) - b64_signature = m2.group(1) - signature = base64.b64decode(b64_signature) - # Build the message - signing_alg = self.signing_cfg.signing_algorithm - if signing_alg is None: - # Determine default - if isinstance(self.pubkey, RSA.RsaKey): - signing_alg = signing.ALGORITHM_RSASSA_PSS - elif isinstance(self.pubkey, ECC.EccKey): - signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3 - else: - self._tc.fail("Unsupported key: {0}".format(type(self.pubkey))) - - if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15: - pkcs1_15.new(self.pubkey).verify(digest, signature) - elif signing_alg == signing.ALGORITHM_RSASSA_PSS: - pss.new(self.pubkey).verify(digest, signature) - elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3: - verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, - encoding='der') - verifier.verify(digest, signature) - elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979: - verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979, - encoding='der') - verifier.verify(digest, signature) - else: - self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg)) - -class PetApiTests(unittest.TestCase): - - @classmethod - def setUpClass(cls): - cls.setUpModels() - cls.setUpFiles() - - @classmethod - def tearDownClass(cls): - file_paths = [ - cls.rsa_key_path, - cls.rsa4096_key_path, - cls.ec_p521_key_path, - ] - for file_path in file_paths: - Path(file_path).unlink() - - @classmethod - def setUpModels(cls): - cls.category = category.Category() - cls.category.id = id_gen() - cls.category.name = "dog" - cls.tag = tag.Tag() - cls.tag.id = id_gen() - cls.tag.name = "python-pet-tag" - cls.pet = pet.Pet( - name="hello kity", - photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"] - ) - cls.pet.id = id_gen() - cls.pet.status = "sold" - cls.pet.category = cls.category - cls.pet.tags = [cls.tag] - - @classmethod - def setUpFiles(cls): - cls.test_file_dir = Path(__file__, "..", "..", "testfiles").resolve() - cls.test_file_dir.mkdir(exist_ok=True) - - cls.private_key_passphrase = "test-passphrase" - cls.rsa_key_path = cls.test_file_dir / "rsa.pem" - cls.rsa4096_key_path = cls.test_file_dir / "rsa4096.pem" - cls.ec_p521_key_path = cls.test_file_dir / "ecP521.pem" - - if not cls.rsa_key_path.exists(): - with open(cls.rsa_key_path, 'w') as f: - f.write(RSA_TEST_PRIVATE_KEY) - - if not cls.rsa4096_key_path.exists(): - key = RSA.generate(4096) - private_key = key.export_key( - passphrase=cls.private_key_passphrase, - protection='PEM' - ) - with open(cls.rsa4096_key_path, "wb") as f: - f.write(private_key) - - if not cls.ec_p521_key_path.exists(): - key = ECC.generate(curve='P-521') - private_key = key.export_key( - format='PEM', - passphrase=cls.private_key_passphrase, - use_pkcs8=True, - protection='PBKDF2WithHMAC-SHA1AndAES128-CBC' - ) - with open(cls.ec_p521_key_path, "wt") as f: - f.write(private_key) - - def test_valid_http_signature(self): - privkey_path = self.rsa_key_path - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=privkey_path, - private_key_passphrase=self.private_key_passphrase, - signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, - signed_headers=[ - signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type' - ] - ) - config = Configuration(host=HOST, signing_info=signing_cfg) - # Set the OAuth2 access_token to None. Here we are interested in testing - # the HTTP signature scheme. - config.access_token = None - - api_client = petstore_api.ApiClient(config) - pet_api = PetApi(api_client) - - mock_pool = MockPoolManager(self) - api_client.rest_client.pool_manager = mock_pool - - mock_pool.set_signing_config(signing_cfg) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': r'application/json', - 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - r'headers="\(request-target\) \(created\) host date digest content-type",' - r'signature="[a-zA-Z0-9+/=]+"', - 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - pet_api.add_pet(self.pet) - - def test_valid_http_signature_with_defaults(self): - privkey_path = self.rsa4096_key_path - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=privkey_path, - private_key_passphrase=self.private_key_passphrase, - ) - config = Configuration(host=HOST, signing_info=signing_cfg) - # Set the OAuth2 access_token to None. Here we are interested in testing - # the HTTP signature scheme. - config.access_token = None - - api_client = petstore_api.ApiClient(config) - pet_api = PetApi(api_client) - - mock_pool = MockPoolManager(self) - api_client.rest_client.pool_manager = mock_pool - - mock_pool.set_signing_config(signing_cfg) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': r'application/json', - 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - r'headers="\(created\)",' - r'signature="[a-zA-Z0-9+/=]+"', - 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - pet_api.add_pet(self.pet) - - def test_valid_http_signature_rsassa_pkcs1v15(self): - privkey_path = self.rsa4096_key_path - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=privkey_path, - private_key_passphrase=self.private_key_passphrase, - signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, - signed_headers=[ - signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - ] - ) - config = Configuration(host=HOST, signing_info=signing_cfg) - # Set the OAuth2 access_token to None. Here we are interested in testing - # the HTTP signature scheme. - config.access_token = None - - api_client = petstore_api.ApiClient(config) - pet_api = PetApi(api_client) - - mock_pool = MockPoolManager(self) - api_client.rest_client.pool_manager = mock_pool - - mock_pool.set_signing_config(signing_cfg) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': r'application/json', - 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - r'headers="\(request-target\) \(created\)",' - r'signature="[a-zA-Z0-9+/=]+"', - 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - pet_api.add_pet(self.pet) - - def test_valid_http_signature_rsassa_pss(self): - privkey_path = self.rsa4096_key_path - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=privkey_path, - private_key_passphrase=self.private_key_passphrase, - signing_algorithm=signing.ALGORITHM_RSASSA_PSS, - signed_headers=[ - signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - ] - ) - config = Configuration(host=HOST, signing_info=signing_cfg) - # Set the OAuth2 access_token to None. Here we are interested in testing - # the HTTP signature scheme. - config.access_token = None - - api_client = petstore_api.ApiClient(config) - pet_api = PetApi(api_client) - - mock_pool = MockPoolManager(self) - api_client.rest_client.pool_manager = mock_pool - - mock_pool.set_signing_config(signing_cfg) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': r'application/json', - 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - r'headers="\(request-target\) \(created\)",' - r'signature="[a-zA-Z0-9+/=]+"', - 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - pet_api.add_pet(self.pet) - - def test_valid_http_signature_ec_p521(self): - privkey_path = self.ec_p521_key_path - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=privkey_path, - private_key_passphrase=self.private_key_passphrase, - hash_algorithm=signing.HASH_SHA512, - signed_headers=[ - signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - ] - ) - config = Configuration(host=HOST, signing_info=signing_cfg) - # Set the OAuth2 access_token to None. Here we are interested in testing - # the HTTP signature scheme. - config.access_token = None - - api_client = petstore_api.ApiClient(config) - pet_api = PetApi(api_client) - - mock_pool = MockPoolManager(self) - api_client.rest_client.pool_manager = mock_pool - - mock_pool.set_signing_config(signing_cfg) - mock_pool.expect_request('POST', HOST + '/pet', - body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': r'application/json', - 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - r'headers="\(request-target\) \(created\)",' - r'signature="[a-zA-Z0-9+/=]+"', - 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=None) - - pet_api.add_pet(self.pet) - - def test_invalid_configuration(self): - # Signing scheme must be valid. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme='foo', - private_key_path=self.ec_p521_key_path - ) - self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # Signing scheme must be specified. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - private_key_path=self.ec_p521_key_path, - signing_scheme=None - ) - self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # Private key passphrase is missing but key is encrypted. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.ec_p521_key_path, - ) - self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # File containing private key must exist. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path='foobar', - ) - self.assertTrue(re.match('Private key file does not exist', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # The max validity must be a positive value. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.ec_p521_key_path, - signature_max_validity=timedelta(hours=-1) - ) - self.assertTrue(re.match('The signature max validity must be a positive value', - str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # Cannot include the 'Authorization' header. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.ec_p521_key_path, - signed_headers=['Authorization'] - ) - self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - # Cannot specify duplicate headers. - with self.assertRaises(Exception) as cm: - signing_cfg = signing.HttpSigningConfiguration( - key_id="my-key-id", - signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.ec_p521_key_path, - signed_headers=['Host', 'Date', 'Host'] - ) - self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter', - str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py deleted file mode 100644 index eff7298d9f3d..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue - - -class TestIntegerEnumOneValue(unittest.TestCase): - """IntegerEnumOneValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIntegerEnumOneValue(self): - """Test IntegerEnumOneValue""" - model = IntegerEnumOneValue() - assert model.value == 0, "With only one option, the value is assigned automatically" - - model = IntegerEnumOneValue(0) - assert model.value == 0, "We can also pass in the value as a positional arg" - - model = IntegerEnumOneValue(value=0) - assert model.value == 0, "We can also pass in the value as a named argument" - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py deleted file mode 100755 index b945f178fee4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.dog import Dog -from petstore_api.model.legs import Legs - - -class TestSetAttrForComposedSchema(unittest.TestCase): - """TestSetAttrForComposedSchema unit test""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSetAttrForComposedSchema(self): - """Test SetAttrForComposedSchema""" - try: - dog_instance = Dog(class_name="Dog", color="Black") - dog_instance.breed = "bulldog" - dog_instance.legs = Legs(legs="4") - except petstore_api.exceptions.ApiTypeError: - self.assertTrue(False) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py deleted file mode 100755 index 7c14b5f7e7a4..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest -import json -from collections import namedtuple - -import petstore_api -from petstore_api.model.animal import Animal -from petstore_api.model.dog import Dog - - -class TestReadOnlyForComposedSchema(unittest.TestCase): - """TestReadOnlyForComposedSchema unit test""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyForComposedSchema(self): - """Test ReadOnlyForComposedSchema""" - MockResponse = namedtuple('MockResponse', 'data') - client = petstore_api.ApiClient() - """ deserialize dict(str, Enum_Test) """ - data = { - "Dog": { - "class_name": "Dog", - "breed": "BullDog", - "color": "Black", - "tail": True - } - } - response = MockResponse(data=json.dumps(data)) - deserialized = client.deserialize(response, ({str: (Dog,)},), True) - assert isinstance(deserialized, dict) - assert isinstance(deserialized['Dog'], Dog) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py deleted file mode 100644 index 3ed00dd79817..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import whale -except ImportError: - whale = sys.modules[ - 'petstore_api.model.whale'] -try: - from petstore_api.model import zebra -except ImportError: - zebra = sys.modules[ - 'petstore_api.model.zebra'] -from petstore_api.model.mammal import Mammal - - -class TestMammal(unittest.TestCase): - """Mammal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMammal(self): - """Test Mammal""" - - # tests that we can make a BasquePig by traveling through descendant discriminator in Pig - model = Mammal(class_name="BasquePig") - from petstore_api.model import basque_pig - assert isinstance(model, basque_pig.BasquePig) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py deleted file mode 100644 index fa8bf28c3088..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest -from petstore_api.exceptions import ApiAttributeError - -import petstore_api - -try: - from petstore_api.model import mole -except ImportError: - mole = sys.modules["petstore_api.model.mole"] - - -class TestMole(unittest.TestCase): - """Triangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMole(self): - # includes required parameters that are `readOnly=False` and not defined `readOnly` - my_mole = mole.Mole(smell="dirt", hearing=False) - assert my_mole.smell == "dirt" - assert my_mole.hearing is False - - # includes required parameters that `readOnly=False`, an optional `readOnly=False` and not defined `readOnly` - my_mole = mole.Mole(smell="dirt", taste="kfc", hearing=True) - assert my_mole.smell == "dirt" - assert my_mole.taste == "kfc" - assert my_mole.hearing is True - - # includes required parameters that `readOnly=False`, and required not defined `readOnly`, and an optional not defined - my_mole = mole.Mole(smell="dirt", seeing_ghosts=True, hearing=False) - assert my_mole.smell == "dirt" - assert my_mole.seeing_ghosts is True - assert my_mole.hearing is False - - # passing in required readOnly parameters raises an exception - with self.assertRaises(ApiAttributeError): - mole.Mole(smell="dirt", hearing=False, blind=True) - - # passing in optional readOnly parameters raises an exception - with self.assertRaises(ApiAttributeError): - mole.Mole(smell="dirt", hearing=False, touch=True) - - # passing in required an optional parameters with readOnly true or false works with from_openapi_data - my_mole = mole.Mole._from_openapi_data( - smell="dirt", - taste="kfc", - blind=True, - touch=False, - hearing=True, - seeing_ghosts=False, - ) - assert my_mole.smell == "dirt" - assert my_mole.taste == "kfc" - assert my_mole.blind is True - assert my_mole.touch is False - assert my_mole.hearing is True - assert my_mole.seeing_ghosts is False - - -if __name__ == "__main__": - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py deleted file mode 100644 index f4264ca82ea3..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.number_with_validations import NumberWithValidations - - -class TestNumberWithValidations(unittest.TestCase): - """NumberWithValidations unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberWithValidations(self): - """Test NumberWithValidations""" - valid_values = [10.0, 15.0, 20.0] - for valid_value in valid_values: - model = NumberWithValidations(valid_value) - assert model.value == valid_value - - invalid_values = [9.0, 21.0] - for invalid_value in invalid_values: - with self.assertRaises(petstore_api.ApiValueError): - NumberWithValidations(invalid_value) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py deleted file mode 100644 index c708237acb42..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.readonly import Readonly - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectModelWithRefProps(self): - """Test ObjectModelWithRefProps""" - from petstore_api.model.number_with_validations import NumberWithValidations - self.assertEqual( - ObjectModelWithRefProps.openapi_types, - { - 'my_number': (NumberWithValidations,), - 'my_readonly': (Readonly,), - 'my_string': (str,), - 'my_boolean': (bool,), - } - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py deleted file mode 100644 index a57f9b8527ae..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] -from petstore_api.model.parent_pet import ParentPet - - -class TestParentPet(unittest.TestCase): - """ParentPet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testParentPet(self): - """Test ParentPet""" - - # test that we can make a ParentPet from a ParentPet - # which requires that we travel back through ParentPet's allOf descendant - # GrandparentAnimal, and we use the descendant's discriminator to make ParentPet - model = ParentPet(pet_type="ParentPet") - assert isinstance(model, ParentPet) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py deleted file mode 100644 index 63f74ae541fb..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import complex_quadrilateral -except ImportError: - complex_quadrilateral = sys.modules[ - 'petstore_api.model.complex_quadrilateral'] -try: - from petstore_api.model import simple_quadrilateral -except ImportError: - simple_quadrilateral = sys.modules[ - 'petstore_api.model.simple_quadrilateral'] -from petstore_api.model.quadrilateral import Quadrilateral - - -class TestQuadrilateral(unittest.TestCase): - """Quadrilateral unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testQuadrilateral(self): - """Test Quadrilateral""" - instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral") - assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) - instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral") - assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py deleted file mode 100644 index a2b59fc6f31c..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] -from petstore_api.model.shape import Shape - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_recursionlimit(self): - """Test case for recursionlimit - - """ - assert sys.getrecursionlimit() == 1234 - - def testShape(self): - """Test Shape""" - from petstore_api.model import complex_quadrilateral - from petstore_api.model import simple_quadrilateral - from petstore_api.model import equilateral_triangle - from petstore_api.model import isosceles_triangle - from petstore_api.model import scalene_triangle - - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="EquilateralTriangle" - ) - assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" - ) - assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="ScaleneTriangle" - ) - assert isinstance(tri, scalene_triangle.ScaleneTriangle) - - quad = Shape( - shape_type="Quadrilateral", - quadrilateral_type="ComplexQuadrilateral" - ) - assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) - - quad = Shape( - shape_type="Quadrilateral", - quadrilateral_type="SimpleQuadrilateral" - ) - assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) - - # No discriminator provided. - err_msg = ("Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: ()" - ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("shapeType") - ): - Shape() - - # invalid shape_type (first discriminator). 'Circle' does not exist in the model. - err_msg = ("Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '{}'='{}' at path: ()" - ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("shapeType", "Circle") - ): - Shape(shape_type="Circle") - - # invalid quadrilateral_type (second discriminator) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("quadrilateralType", "Triangle") - ): - Shape( - shape_type="Quadrilateral", - quadrilateral_type="Triangle" - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py deleted file mode 100644 index 87092d66d388..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.string_enum import StringEnum - - -class TestStringEnum(unittest.TestCase): - """StringEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringEnum(self): - """Test StringEnum""" - inst = StringEnum(None) - self.assertIsNone(inst) - - inst = StringEnum('approved') - assert isinstance(inst, StringEnum) - - with self.assertRaises(petstore_api.ApiValueError): - StringEnum('garbage') - - # make sure that we can access its allowed_values - assert StringEnum.allowed_values[('value',)] == { - 'None': None, - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - 'DOUBLE_QUOTE_WITH_NEWLINE': "double quote \n with newline", - 'MULTIPLE_LINES': "multiple\nlines", - 'SINGLE_QUOTED': "single quoted" - } - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py deleted file mode 100644 index ec945f6b30b8..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -from petstore_api.model.tag import Tag - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_can_ingest_additional_properties_in_tag(self): - t = Tag(a='abc') - assert t.a == 'abc' - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py deleted file mode 100644 index 7268022cad52..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import petstore_api -try: - from petstore_api.model import equilateral_triangle -except ImportError: - equilateral_triangle = sys.modules[ - 'petstore_api.model.equilateral_triangle'] -try: - from petstore_api.model import isosceles_triangle -except ImportError: - isosceles_triangle = sys.modules[ - 'petstore_api.model.isosceles_triangle'] -try: - from petstore_api.model import scalene_triangle -except ImportError: - scalene_triangle = sys.modules[ - 'petstore_api.model.scalene_triangle'] -from petstore_api.model.triangle import Triangle - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTriangle(self): - """Test Triangle""" - tri = Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle") - assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - tri = Triangle(shape_type="Triangle", triangle_type="IsoscelesTriangle") - assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - tri = Triangle(shape_type="Triangle", triangle_type="ScaleneTriangle") - assert isinstance(tri, scalene_triangle.ScaleneTriangle) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/util.py b/samples/openapi3/client/petstore/python-prior/tests_manual/util.py deleted file mode 100644 index 113d7dcc5478..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tests_manual/util.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -import random - - -def id_gen(bits=32): - """ Returns a n-bit randomly generated int """ - return int(random.getrandbits(bits)) diff --git a/samples/openapi3/client/petstore/python-prior/tox.ini b/samples/openapi3/client/petstore/python-prior/tox.ini deleted file mode 100644 index 8989fc3c4d96..000000000000 --- a/samples/openapi3/client/petstore/python-prior/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=petstore_api